Because only block elements will have physical properties in css inside the world, there are three forms of things,
1 block elements. Features: physical attributes, width, height write the value of work, but also to occupy his party.
2. inline elements. Features: no physical attributes. But the margin, padding value is useful. Does not occupy a row, behind may have siblings.
3 is a block that is inline, determined according sibling siblings.
Why will have physical properties after float, that's the problem with block inline elements into each other.
Block element -> inline elements: display: inline;
inline element -> block elements: the display: Block;
a float is recessive to inline elements into a block element, which is characteristic of the interior is the physical properties, but he does not occupy his party. Foreign property is inline elements. He has a disadvantage that can affect siblings. It is equivalent to: display: inline-block;
why does not directly display: inline-block; because this thing has a few bug px in ie6.
Reprinted from: https: //blog.csdn.net/u012698342/article/details/57419605