css – 究竟是什么显示:block;做一个元素?

前端之家收集整理的这篇文章主要介绍了css – 究竟是什么显示:block;做一个元素?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
显示的具体规格是什么?我知道很多具体的东西应用到一个元素会做,但我想听到他们的一切.

谢谢.

解决方法

Quote from W3C

In a block formatting context,Boxes are laid out one after the other,vertically,beginning at the top of a containing block. The vertical distance between two sibling Boxes is determined by the ‘margin’ properties. Vertical margins between adjacent block Boxes in a block formatting context collapse.

In a block formatting context,each Box’s left outer edge touches the left edge of the containing block (for right-to-left formatting,right edges touch). This is true even in the presence of floats (although a Box’s content area may shrink due to the floats).

猜你在找的CSS相关文章