HighDots Forums  

CSS - 3 columns - footer

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss CSS - 3 columns - footer in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Will Buntin
 
Posts: n/a

Default CSS - 3 columns - footer - 09-10-2004 , 08:57 PM






I am trying to design my site without tables, using CSS for
positioning and am having limited success. My main issue is I have a
three column layout and my footer needs to run across the page, after
the longest content from any column has finished. I've found a few
examples and I thought I had mine set up correctly, but obviously
something is wrong. So if there is any CSS expert out there willing to
give me some tips...

The page is http://www.ukhoopsfans.com/csstest2.php

The CSS is

body {
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
margin: 0;
padding: 0;
}

td {
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
}

th {
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
}

h2 {
background-color:#CCCCCC;
color:#003399;
font-size: larger;
}

#header {
clear: both;
margin-left: 10px;
text-align: center;
color: #000;
border-bottom: 1px solid #333;

}

#leftcol {
position: absolute;
left; 0;
width: 150px;
margin-left: 10px;
margin-top: 0px;
color: #000;
padding: 3px;
}

#rightcol {
position: absolute;
left: 80%;
width: 140px;
padding-left: 10px;
z-index: 3;
color: #000;
padding: 3px;
}

#content {
margin-right: 0px 25% 0 165px;
padding: 3px;
color: #000;
}


#footer {
clear: both;
width: 95%;
margin: 10px;
text-align: center;
padding: 3px;
bordoer-top: 1px solid #333;
color: #000;
}

Reply With Quote
  #2  
Old   
Neal
 
Posts: n/a

Default Re: CSS - 3 columns - footer - 09-11-2004 , 12:07 AM






On 10 Sep 2004 18:57:10 -0700, Will Buntin <adamspt2 (AT) gmail (DOT) com> wrote:

Quote:
I am trying to design my site without tables, using CSS for
positioning and am having limited success. My main issue is I have a
three column layout and my footer needs to run across the page, after
the longest content from any column has finished. I've found a few
examples and I thought I had mine set up correctly, but obviously
something is wrong. So if there is any CSS expert out there willing to
give me some tips...

The page is http://www.ukhoopsfans.com/csstest2.php
I'll happily point out problems I see relating to your current issue and
otherwise.

Quote:
The CSS is

body {
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
margin: 0;
padding: 0;
}
If you were to shrink the text at all from default, Verdana would be a
problem. As it is, I think this is acceptable, but be aware the
replacements for Verdana if it isn't available on the machine will seem
smaller.

Quote:
td {
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
}

th {
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
}
You could set these together. I'd do all the above like this:

body, td, th {
font-family: Verdana, Geneva, Arial, helvetica, sans-serif;
}

body {
margin: 0;
padding: 0;
}

Quote:
#header {
clear: both;
margin-left: 10px;
text-align: center;
color: #000;
border-bottom: 1px solid #333;

}
Why clear: both? clear is used to clear a floated element, and you haven't
used any. So this isn't needed.

Quote:
#leftcol {
position: absolute;
left; 0;
width: 150px;
margin-left: 10px;
margin-top: 0px;
color: #000;
padding: 3px;
}
Absolute takes the element out of the flow and positions it relative to
the containing block, in this case body. So that's why the column is to
the top of the viewport.

As the height of #header is determined by the image, use that pixel value
as the top: offset.

Quote:
#rightcol {
position: absolute;
left: 80%;
width: 140px;
padding-left: 10px;
z-index: 3;
color: #000;
padding: 3px;
}
Same here.

Quote:
#content {
margin-right: 0px 25% 0 165px;
padding: 3px;
color: #000;
}
No need for a value on 0 widths. 0px can just be 0.

Quote:
#footer {
clear: both;
Again, clear what?

Quote:
width: 95%;
margin: 10px;
text-align: center;
padding: 3px;
bordoer-top: 1px solid #333;
color: #000;
}
But the actual CSS reads:

#footer {

position: absolute;
bottom: 0;
width: 100%;
//clear: both;
//width: 95%;
//margin: 10px;
//text-align: center;
//padding: 3px;
//border-top: 1px solid #333;
//color: #000;
}

which is kinda a mess. You sure don't want position: absolute here.

Here's the thing: if the center section will always be taller than the
sides, you don't need to position at all, it'll land there in normal flow.
But, if it might not be, then you need to float the side columns instead
of positioning them. Then the clear: both in the footer will be below the
floats for sure.

Read up on floats. Takes a little getting used to but I think you'll want
to float the columns here.


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.