Jump to content

My Divs are not containing


AbydosGater

Recommended Posts

Hey guys.. Im a complete noob when it gets to CSS so i dont know whats wrong here.

 

If you look at www.abydosgaters.com/bad

See how when the main div with the content closes after "X categorys listed"... The whole div closes but the menu div keeps going and it messes up and looks bad.

 

Does anyone know how i could edit the css or html so that the main content div doesnt close until the menu div closes?

 

Andy

Link to comment
https://forums.phpfreaks.com/topic/61727-my-divs-are-not-containing/
Share on other sites

Don't use:

 

<div style="clear: both;"> </div>

 

That won't work in all situations and browsers...it is also not semantic xhtml markup. Someone in these forums pointed me to the best method for clearing floats:

 

http://www.positioniseverything.net/easyclearing.html

 

I've seen some well known sites aren't bothering with the IE-mac hack and are managing to further reduce their markup by avoiding the addition of a "clearfix" class to the xhtml. Your stylesheet would contain something like:

 

#content:after {
    content: "."; 
    display: block; 
    height: 0; 
    clear: both; 
    visibility: hidden;
}

About the clear: both and the "hack" way of doing it...

 

Well, after writing up my own pages in css for about month now, I can see why that helps. But what I do, is I have the next block do "clear: both;" and then have no margin-top set but instead, have padding-top set. This works just fine in opera, firefox and IE6.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.