盒模型了解一下?

118 阅读1分钟
  • height

    设置为百分数时是相对于父级height而言,父级height要确定(设置了确定值或能算出确定值)设置为%才有意义

  • margin折叠

.a{ margin-bottom:100px;}//该元素下面100px内不能放盒子
.b{ margin-top:100px;}
  • box-sizing

    • 取值:border-box|content-box(默认)
  • border

    • border-style: none | solid | dashed | dotted | double
  • overflow

    • 溢出控制
    • visible(初始值)|hidden| scroll(一直有滚动条) | auto(需要时有滚动条)