473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

CSS - 3 columns - footer

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;
}
Jul 20 '05 #1
1 2964
On 10 Sep 2004 18:57:10 -0700, Will Buntin <ad******@gmail.com> wrote:
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.
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.
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;
}
#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.
#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.
#rightcol {
position: absolute;
left: 80%;
width: 140px;
padding-left: 10px;
z-index: 3;
color: #000;
padding: 3px;
}
Same here.
#content {
margin-right: 0px 25% 0 165px;
padding: 3px;
color: #000;
}
No need for a value on 0 widths. 0px can just be 0.
#footer {
clear: both;
Again, clear what?
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.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

82
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | ...
2
by: DFS | last post by:
Main report contains one large graph in the detail band (no detail records). Subreport snakes just fine (5 columns) when opening by itself. When I add it to the main report (in the report...
4
by: Alex | last post by:
I have a main report (single column report and page headers and footers) and a 4 column subreport in the detail section. The report will generally be a single page. Everything prints fine except...
2
by: Nicole | last post by:
I am creating template columns programmatically. I have read the msdn article on this and I'm so close. Article:...
1
by: Olav Tollefsen | last post by:
Is it possible to create a DataGrid footer to span multiple columns? Olav
5
by: Gary Blakely | last post by:
I'm giving this post another try - it can't be too difficult for everyone.... In the program below, the web page has dataGrid1. the only thing that has been done to it at design time is to...
2
by: David C | last post by:
I followed the torial using this from MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vste chart/html/vbtchCreatingWebServerControlTemplatesProgrammatically.asp to...
16
by: Edward | last post by:
This is a three-column DIV page with a menu bar DIV under them. Easy enough with table layouting but with CSS I can't get it to work: http://tanguay.info/web/examples/threeColumnsColor.htm 1....
14
by: varois83 | last post by:
Hi The code I am pasting below is just practice so the colors are goofy, it's to help me see what is where. The text isn't styled either at this time. I am working on a fixed 2...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.