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
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;
}

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.