4 ms·
Does anyone know the drawbacks of simply using: .container { display: table; width: 100%; } See bottom example here http://codepen.io/jrf0
by JohnDotAwesome 10y ago
Does anyone know the drawbacks of simply using:
.container {
display: table;
width: 100%;
}
See bottom example here http://codepen.io/jrf0110/pen/xgXPGj http://codepen.io/jrf0110/pen/xgXPGj
I've never had to use the clearfix hack (that's probably a lie, but I can't recall a time in my career where I didn't just use the display: table; width: 100%; method)
- camtarn 10y agoIt wasn't supported until IE8. For those of us who had to support IE6 till well after its sell-by date, prop-based clearing was an important tool in the toolbox.
- talmand 10y agoIf the browser doesn't support display: table, you could just put overflow: auto on the container and it'll expand to contain the floats.
- smaili 10y agohttp://caniuse.com/#feat=css-table http://caniuse.com/#feat=css-table