Note that there are some explanatory texts on larger screens.

plurals
  1. POClean CSS fix of IE7's 'float: right' drop bug
    primarykey
    data
    text
    <p>I continuously find myself having problems with elements floated right in IE7. </p> <p>I have read many Stack Overflow questions which are similar to this one but there doesn't seem to be any consistently clean CSS answers.</p> <p>What I mean by this is is I want to see answers which <strong>DO NOT change the HTML</strong>. E.g:</p> <ul> <li>Put the floated element first</li> <li>Add a 'clear: both' div after the floated element.</li> </ul> <p>I understand that sometimes the floated element doesn't account for its parents height and therefore sometimes fails to contain it properly. Occasionally I find myself 'adding layout' to an element with zoom: 1 which sometimes fixes it. Other times I find myself messing about in a conditional IE7 style-sheet which isn't the best fix in my opinion.</p> <p>Note: What I mean by 'having layout' - <a href="http://www.satzansatz.de/cssd/onhavinglayout.html">http://www.satzansatz.de/cssd/onhavinglayout.html</a></p> <p>I have also read other answers to do with using relative and absolute positioning (parent div and child div respectively). This pulls it up but often affects surrounding divs.</p> <p>I would be happy to add a bounty to this question if someone can give an in depth explain as to the reasons this happens and a detailed discussion of the various fixes, <strong>IDEALLY CSS ONLY!</strong></p> <p>Many thanks!</p> <p>EDIT</p> <p>The most common problem I encounter is when I have something like this:</p> <p>Left Sidebar - Main - Right Sidebar</p> <p>Right will often drop when floated. Ideally this should be in the format Left - Right - Main, but I continuously find myself styling developers work (Drupal mainly) where this is the case and it is too much hassle to get them to change their work. Make sense? Because I'm styling developers work they never put the clear block in too (which personally I think is horrible and dirty anyways!)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload