Jump to content

clear: both


brown2005

Recommended Posts

on another topic someone has said

 

"you never cleared the floats. Use <div class="clear"></div> .class { clear: both; } or the "new modern day clearing methods."

 

what are the modern day clearing methods???

 

and when should i use the .clear on all divs? or a certain div?

Link to comment
Share on other sites

That was me who said that... I would appreciate some credit!  :D

 

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

 

Everything is explained there!

 

Like I said when you asked about this FilmGod, that method is somewhat "outdated" because it still involves editing the html to clear. You can see my method, an adaptation of the concepts in that article but using only css, here:

 

http://www.phpfreaks.com/forums/index.php/topic,184490.0.html

Link to comment
Share on other sites

That was me who said that... I would appreciate some credit!  :D

 

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

 

Everything is explained there!

 

Like I said when you asked about this FilmGod, that method is somewhat "outdated" because it still involves editing the html to clear. You can see my method, an adaptation of the concepts in that article but using only css, here:

 

http://www.phpfreaks.com/forums/index.php/topic,184490.0.html

 

Sorry - but maybe I didn't get something. The link I originally provided does not involve editing the html. It's all in the css.

Link to comment
Share on other sites

You don't have to have clear:both you can do something like

 

.container{
  width:100%;
  display:block;
  overflow:hidden;
}

.left{
  width:30%;
  float:left;
  display:block;
}

.right{
  width:69%;
  float:right;
  display:block;
}

 

<div class="container">
  <div class="left"></div>
  <div class="right"></div>
</div>

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.