CSS : “float” property vs “Display:inline-block”
I confess that I’ve never worked with the CSS attribute “display: inline-block“, I thank Firebug and error in the Live.com site for this discovery.
This property allows to apply two kinds of “display” for the same element, in addition there is an equivalent for FireFox as well, namely “display:-moz-inline-box“.
Example :
#content div.left{
width:180px;
display:-moz-inline-box;
display:inline-block;
}
/* Hack for IE */
* html #content div.left{
display:inline;
}
Another advantages :
Consideration of the property “vertical-align“.
Ability to leave free the height of the element, unlike “float”.
See “float:left” vs “display:block-inline” fight
Are you ready to kill FLOAT ??
October 7th, 2009 in
Development, Tricks | tags: display:inline-block, FLOAT vs Display:inline-block, vertical-align |
3 Comments