Re: 2 column layout
- From: Jef Driesen <jefdriesen@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Jul 2006 11:59:03 +0200
Jef Driesen wrote:
I have created a nice idea for a website and now I would like to
translate that idea in (x)html and css. The layout is quite basic: a
header, two columns and a footer. For a graphical presentation, see
http://users.telenet.be/sacn/tmp/layout.png.
I would like to have:
* source ordered columns: header, content, sidebar, footer
* fixed width columns (either px or em units). Because I don't like
reading very long lines and IE does not support the max/max-height
properties.
* columns don't need to have their own background color or image (no
faux columns or equal-height colums necessary).
* fixed height header (I will place a background image here)
* everything centered in the browser window
* good browser support: IE5+, Gecko, Opera,...
I want to use as few div's as possible, e.g. something like below:
<div id="container">
<div id="header"></div>
<div id="main">
<div id="content"></div>
<div id="sidebar"></div>
</div>
<div id="footer"></div>
</div>
I did search on the internet for a suitable template to start with, but
couldn't find one.
I have created a template using floats and negative margins, inspired by an article at http://www.alistapart.com/articles/negativemargins/.
First I created the basic two column layout (http://users.telenet.be/sacn/tmp/v1/) and added some horizontal padding later (http://users.telenet.be/sacn/tmp/v2/), which needs a box model hack in IE5.x.
There are some issues caused by the margins of the <h1> and <p> elements in the header and footer, but removing the margins and adding padding to their parent elements can fix that: http://users.telenet.be/sacn/tmp/v3/ Only in IE6 the top padding of the footer is too large now.
In IE, there is also no bottom margin for the container div. Changing around some margin and padding does fix this also: http://users.telenet.be/sacn/tmp/v4/.
There is one problem left in IE5.x. The top and bottom margins of the content and sidebar (actually the margins of the first and last element inside them) disappear. I could add some padding (http://users.telenet.be/sacn/tmp/v5), but this breaks in modern browsers because there is to much space now (padding+margin). And I don't know a method to fix that!
Opera 7+ seems fine already. Can someone check and report in some other browsers?
.
- Follow-Ups:
- Re: 2 column layout
- From: Beauregard T. Shagnasty
- Re: 2 column layout
- References:
- 2 column layout
- From: Jef Driesen
- 2 column layout
- Prev by Date: Re: What fonts are equivalent on different platforms?
- Next by Date: Re: 2 column layout
- Previous by thread: Re: 2 column layout
- Next by thread: Re: 2 column layout
- Index(es):
Relevant Pages
|