5
When testing with alignment of div
, both have the same purpose
But what would be your difference?
5
When testing with alignment of div
, both have the same purpose
But what would be your difference?
4
inline-block
is the junction of behaviors inline
(ex.: occupy only the space of the content, not break line) and block
(eg: configurable dimensions) in a single HTML element
float
causes the element to fluctuate in the direction specified above the other HTML elements.
They may be similar because the float adds some features that the inline-block
also possesses, but not all.
2
In some situations one can replace the other, but they don’t necessarily do the same thing. Take a look at this article http://www.tutorialwebdesign.com.br/display-vs-float/ that has explanation with examples.
Great reference article! I’ve always used/use the float
, but I found the comparisons interesting... maybe start testing the inline-block
also.
1
Float: left;
The element floats to the left
Display:inline-block
Displays an element as an inline-level block container. The Inside of this block is Formatted as block-level box, and the element itself is Formatted as an inline-level box
Basically, the left float only throws things to the left, whereas the inline-block arrow they must acquire line shape while there is space and when the space runs out it, block-shaped, breaks to the next line.
At the beginning links have examples.
Browser other questions tagged css css3
You are not signed in. Login or sign up in order to post.
You could post the code where it was tested?
– William Pereira
In certain contexts they may have the same result, but it certainly does not have the same purpose.
– utluiz