HighDots Forums  

CSS layout problem: Shouldn't this be a simple thing?

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


Discuss CSS layout problem: Shouldn't this be a simple thing? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Geoff Hague
 
Posts: n/a

Default CSS layout problem: Shouldn't this be a simple thing? - 08-19-2004 , 05:24 PM






I've decided I need to rebuild my website from scratch to work properly
accross browsers (the previous version of the site worked fine in IE6, but
was really wonky in other browsers).

What I'm trying for is a simple layout with a header and two colums (left
and right) positioned immediately below it.

Here's what I've got so far:
http://www.captainsoftheworld.com/mo...test/index.php
http://www.captainsoftheworld.com/mo...rnRepublic.css

As often is the case I suppose, it works perfectly fine in IE. However, I
understand that IE is the worst at properly interpreting CSS; the page looks
quite wrong in Firefox and Mozilla (oh, and the tacky colours are purely for
testing purposes).

Could someone offer a suggestion regarding what I'm doing wrong? I've kept
the HTML and CSS code quite bare to make it easy to look at, I hope.

Thanks very much!

~Geoff



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

Default Re: CSS layout problem: Shouldn't this be a simple thing? - 08-19-2004 , 05:55 PM






Geoff Hague wrote:

Quote:
What I'm trying for is a simple layout with a header and
two colums (left and right) positioned immediately below
it.

Here's what I've got so far:
http://www.captainsoftheworld.com/mo...lic/test/index.
php
http://www.captainsoftheworld.com/mo...ic/test/Modern
Republic.css

As often is the case I suppose, it works perfectly fine in
IE.
Because IE has a broken box-model.

Quote:
However, I understand that IE is the worst at properly
interpreting CSS; the page looks quite wrong in Firefox and
Mozilla (oh, and the tacky colours are purely for testing
purposes).

Could someone offer a suggestion regarding what I'm doing
wrong? I've kept the HTML and CSS code quite bare to make
it easy to look at, I hope.
The problem is that the floats, by their nature, don't
actually use up any space, they're taking out of the normal
flow, just like absolute positioned elements.
This results in the div#SiteBody not being extended to hold
the two floated columns.
The solution to this, is to add a div with the clear:both
property, after the floats, but inside the div#SiteBody.
See my example:
http://locusmeus.com/temp/geoff.html
(with the css inside the file for easy checking)

More info on the subject, floats
http://www.w3.org/TR/CSS21/visuren.html#floats
and the clear property
http://www.w3.org/TR/CSS21/visuren.html#propdef-clear

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Melissa Etheridge - Bring Me Some Water


Reply With Quote
  #3  
Old   
Els
 
Posts: n/a

Default Re: CSS layout problem: Shouldn't this be a simple thing? - 08-19-2004 , 05:57 PM



Els wrote:

Quote:
The problem is that the floats, by their nature, don't
actually use up any space, they're taking out of the normal
^^^^^^
taken

Quote:
flow, just like absolute positioned elements.
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Michael Jackson - Dirty Diana


Reply With Quote
  #4  
Old   
Geoff Hague
 
Posts: n/a

Default Re: CSS layout problem: Shouldn't this be a simple thing? - 08-19-2004 , 07:21 PM



"Els" <els.aNOSPAM (AT) tiscali (DOT) nl> wrote

Quote:
The problem is that the floats, by their nature, don't
actually use up any space, they're taking out of the normal
flow, just like absolute positioned elements.
This results in the div#SiteBody not being extended to hold
the two floated columns.
The solution to this, is to add a div with the clear:both
property, after the floats, but inside the div#SiteBody.
See my example:
http://locusmeus.com/temp/geoff.html
(with the css inside the file for easy checking)
Perfect! Thank you very much!

~Geoff




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 - 2009, Jelsoft Enterprises Ltd.