inline, block, inline-block区别
inline- Not
heightandwidth; - Not
margin-top&margin-bottom; - Always occupy area only necessary.(Actually, the
margin-righthold the rest space from element’s right edge to line right edge.实际上是margin-right填充了该行剩余的宽度)
- Not
block- Having everything to Box Model;
- Full a line.
inline-block- Have everything to Box Model;
- Occupy area only necessary. (
margin-leftwill not hold the rest space of line).
All in all, inline/block/inline-block rule the box model behavior to element:
inline: didn’theight/widthandmargin-top/margin-bottomblock: have everything andmarign-righthold rest space to the line.inline-block: normal act.
本文详细解释了网页布局中三种基本的元素显示模式:inline(内联)、block(块级)及 inline-block(内联块级)。这三种模式决定了元素在页面上的布局行为,包括高度、宽度、内外边距等特性。
6130

被折叠的 条评论
为什么被折叠?



