Website Coding

Stuck on a line of code? Find resources and post your coding questions here.

Forum Sponsor (Advertise with us)
Reply
 
Thread Tools Display Modes
    #1 (permalink)  
Old 04-09-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Tables/Columns CSS Question
I have someone who helped me with a template. It's an HTML document with a CSS external file.

The layout has a header, and then 2 columns for the body. The one on the left is a little wider than the one on the right.

I'm trying to figure out in the code, what makes these columns what they are, their width, etc. Because I want to copy the page and have only 1 column or table, where the content will be on subsequent pages.

Any help on what to look for? I'm new to this. I have the basic text editing down but this is HTML CSS 102 I think, haha.
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
    #2 (permalink)  
Old 04-09-2008
Codehead's Avatar
Administrator
Company name: Codehead LLP
My latest blog post: Mac Performance Benchmark App
 
Join Date: Apr 2007
Location: WA
Posts: 175
Default Re: Tables/Columns CSS Question
Hi Sarah,

Please post some code or post a link to your page so I can take a look at it.

Thanks
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #3 (permalink)  
Old 04-09-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Re: Tables/Columns CSS Question
http://www.creativemain.com/jao.html

here's the basic (this is my designer's rough edit so there are typos in this fyi)
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
    #4 (permalink)  
Old 04-09-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Re: Tables/Columns CSS Question
And here's all of the CSS Text...

body {
margin: 0;
padding: 0;
background: #FFFFFF;
font-size: 12px;
color: #666666;
}

body, th, td, input, textarea, select, option {
font-family: Arial, Helvetica, sans-serif;
}

h1, h2, h3 {
text-transform: none;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-weight: normal;
color: #FF3399;
}

h1 {
letter-spacing: -1px;
font-size: 3em;
}

h2 {
letter-spacing: -1px;
font-size: 1.5em;
}

h3 {
font-size: 1em;
}

blockquote {
padding-left: 1em;
}

blockquote p, blockquote ul, blockquote ol {
line-height: normal;
font-style: italic;
}

a {
color: #666666;
}

a:hover {
text-decoration: none;
}

/* Header */

#header {
width: 778px;
height: 170px;
margin: 0 auto;
background: url(images/img02.jpg) no-repeat;
}

#header h1, #header p {
float: left;
margin: 0;
padding-top: 80px;
line-height: normal;
}

#header h1 {
}

#header p {
padding-left: 10px;
}

#header a {
}

/* Menu */

#menu {
width: 778px;
height: 35px;
background: url(images/img03.jpg) no-repeat;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
padding-bottom: 0px;
}

#menu ul {
margin: 0;
padding: 14px 0 0 0;
list-style: none;
}

#menu li {
display: inline;
}

#menu a {
padding: 0 20px 0 15px;
background: url(images/img04.gif) no-repeat left center;
text-decoration: none;
font-weight: bold;
color: #666666;
}

#menu a:hover {
text-decoration: underline;
}

/* Page */

#page {
width: 778px;
margin: 0 auto;
padding: 20px 0;
}

/* Content */

#content {
float: left;
width: 480px;
}

.post {
padding: 0 0 20px 0;
}

.title {
margin: 0;
border-bottom: 2px solid #4A3903;
}

.byline {
margin: 0;
}

.meta {
border-top: 1px solid #4A3903;
text-align: right;
color: #646464;
}

.meta a {
padding-left: 15px;
background: url(images/img06.gif) no-repeat left center;
font-weight: bold;
}

/* Sidebar */

#sidebar {
float: right;
width: 280px;
}

#sidebar ul {
margin: 0;
padding: 0;
list-style: none;
}

#sidebar li {
}

#sidebar li ul {
padding: 15px 0;
}

#sidebar li li {
padding-left: 30px;
border-bottom: 1px dotted #4A3903;
background: url(images/img06.gif) no-repeat 15px 50%;
}

#sidebar h2 {
margin: 0;
padding: 20px 0 2px 30px;
background: url(images/img05.gif) no-repeat left bottom;
border-bottom: 2px solid #4A3903;
}

#sidebar a {
text-decoration: none;
}

#sidebar a:hover {
text-decoration: underline;
}

/* Footer */

#footer {
width: 778px;
height: 35px;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
padding-bottom: 0px;
background-color: #FF6699;
}
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
    #5 (permalink)  
Old 04-09-2008
Codehead's Avatar
Administrator
Company name: Codehead LLP
My latest blog post: Mac Performance Benchmark App
 
Join Date: Apr 2007
Location: WA
Posts: 175
Default Re: Tables/Columns CSS Question
According to your CSS code, this is the left column:

Code:
#content {
float: left;
width: 480px;
}
And this is the right one:
Code:
#sidebar {
float: right;
width: 280px;
}
Now if you want to make a page with only one column, use this code:

HTML Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Enter Page Title</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="jao.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
body {
    background-color: #FFFFFF;
    background-repeat: no-repeat;
}
.style3 {color: #666666}
</style></head>
<body>
<div id="header">
    <h1>&nbsp;</h1>
</div>
<div id="menu">
    <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About Us</a></li>
        <li><a href="#">Rates</a></li>
        <li><a href="#">Services</a></li>
        <li><a href="#">Contact Us</a></li>
        <li><a href="#">Free Lunch</a></li>
    </ul>
</div>
<div id="page">
    PAGE CONTENTS HERE    
</div>
<div style="clear: both; height: 30px">&nbsp;</div>
<div id="footer">
    <p align="center" class="style3">Jackson Administrative Services  &nbsp;&bull;&nbsp; Designed by <a href="http://www.creativemain.com">www.creativemain.com</a></p>
</div>
</body>
</html>
Please note that I used your exact code and just took out some of it.
Copy and paste this code and replace "PAGE CONTENTS HERE" with your desired contents (text, images, etc.)

I hope this helps
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #6 (permalink)  
Old 04-09-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Re: Tables/Columns CSS Question
Yes I appreciate it. I do want to understand what is happening though.
You basically removed those code out of the HTML: <div id="content"> and <div id="sidebar"> so that it doesn't split the page at all or speak to the CSS file about those divisions at all, correct? I'm not seeing any "END" code for those? I just see one divide? Whereas usually you have <code> and </code>
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
    #7 (permalink)  
Old 04-09-2008
Codehead's Avatar
Administrator
Company name: Codehead LLP
My latest blog post: Mac Performance Benchmark App
 
Join Date: Apr 2007
Location: WA
Posts: 175
Default Re: Tables/Columns CSS Question
Hi Sarah, that's great that you want to understand further.
Here is how it works:

This is the page with both of the columns without content:
HTML Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Enter Page Title</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="jao.css" rel="stylesheet" type="text/css" media="screen" />
<style type="text/css">
<!--
body {
	background-color: #FFFFFF;
	background-repeat: no-repeat;
}
.style3 {color: #666666}
</style></head>
<body>
<div id="header">
	<h1>&nbsp;</h1>
</div>
<div id="menu">
	<ul>
		<li><a href="#">Home</a></li>
		<li><a href="#">About Us</a></li>
		<li><a href="#">Rates</a></li>
		<li><a href="#">Services</a></li>
		<li><a href="#">Contact Us</a></li>
		<li><a href="#">Free Lunch</a></li>
	</ul>
</div>
<div id="page">
	<div id="content"> CONTENT STARTS HERE
		
	</div>
	<div id="sidebar"> SIDE BAR STARTS HERE
		
	</div> 
</div>
<div style="clear: both; height: 30px">&nbsp;</div>
<div id="footer">
	<p align="center" class="style3">Jackson Administrative Services  &nbsp;&bull;&nbsp; Designed by <a href="http://www.creativemain.com">www.creativemain.com</a></p>
</div>
</body>
</html>
Now that I've taken all the contents out, you can see where <div id="content"> and <div id="sidebar"> are ending.

DIVs are like boxes on the page and you can style them using CSS, that is you can change their sizes etc.

DIVs usually stay on top of each other (on the page, in terms of design) rather than next to each other (like on your page) and that is why your CSS looks like this:
Code:
#content {
float: left;
width: 480px;
}
#sidebar {
float: right;
width: 280px;
}
Here "float" changes their 'standard' behavior and <div id="content"></div> goes to the left side of the page because of "float: left;" and the sidebar goes to the right because of "float:right;".

One more important thing to note this is their sizes; the sum of their sizes shouldn't exceed the size of their parent container. <div id="page"></div> is their parent here.

I hope this makes sense and helps you understand what I did
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #8 (permalink)  
Old 04-09-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Re: Tables/Columns CSS Question
yes, very much. understood. and I see that the </div> is the end command. Now I know what the heck all those are for, because I see this </div> all over the layout. HTML seems a lot like more complicated versions of excel formulas to me.

Thanks for taking the time to explain this to me, you must really be passionate about this stuff. The person helping me offered to do more work, but 1.) i didn't want to take advantage, and 2.) i just simply need to learn this.
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
    #9 (permalink)  
Old 04-15-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Re: Tables/Columns CSS Question
after your input codehead, here's what i came up with....
the index page http://www.jacksonao.com which has the 2 columns from the main external css file,
and a secondary page with only one column http://www.jacksonao.com/abouttheowner.html
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 11:20 AM.

International Virtual Assistants Association
Project Management for Virtual Assistants
Work from Home | Become A Virtual Assistant
Virtual Assistant Directory
Affordable Logo Design
Virtual Assistant Contracts
Virtual Assistant Forums Advertising

© Virtual Assistant Forums 2012
All content and images are protected under copyright law and may not be reproduced in any way without express written consent.