Issue with “Inner” div that sets a 20px Padding inside parent div
# April 26, 2013 at 3:43 am
I was using “inner” as a child div with a padding of 20px.
The issue is, when I float an element to the left and the second element to the right the “inner” div totally collapses.
Acts as if there is no padding at all…
I’d have to add a second class attribute named “clearfix” just so the parent div can expand to fit all of it’s content…
I find it quite annoying to repeatedly add “clearfix” to every single div that needs the padding…
I also use 2 divs named “left” and “right” that obviously float left and right.
What can I do to fix this?
[Fiddle](http://jsfiddle.net/WV3qv/2/ “http://jsfiddle.net/WV3qv/2/”)# April 26, 2013 at 5:33 am
> What can I do to fix this?
You could also look into `inline-block`.# April 26, 2013 at 8:46 am
This reply has been reported for inappropriate content.
The CSS flexible box layout module, commonly referred to as flexbox, gives us a brand new layout mode in CSS – flex layout. It has been designed to make it easier to layout complex applications and webpages.
Quote above ( are the first lines of Chapter 2 on Flexbox ) from CSS3 layout modules by Rachel Andrew : recommended
some more links:
You must be logged in to reply to this topic.