View Single Post
Old 12-06-2009, 02:45 PM  
Sands
Confirmed User
 
Sands's Avatar
 
Join Date: Feb 2007
Location: 418194907
Posts: 3,134
Quote:
Originally Posted by Killswitch View Post
I have a div with 3 more divs inside of it, those 3 divs use absolute positioning and left attributes to put them where I want them, I then do .clearFix:after { clear: both; } and set the class of that parent div to clearFix but it's still showing the bottom of the div right up against the bottom of the 3 divs instead of the 15px padding there is supposed to be...
1) Whenever possible, avoid using absolute positioning and instead use float/margin/padding and allow the divs to "fall" into place within the parent element.

2) The :after pseudo-class may not work on older browsers.

3) Setting an overflow attribute for the parent element, whether it's "auto" or "hidden", should be sufficient to clear the floats.
Sands is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote