看奇舞前端课 定位与堆叠、排版细节 随笔

212 阅读1分钟
  • 一行文字竖直居中可以用line-height

  • z-index大的一定在上面吗?

    • 不一定

堆叠

排版细节

line-height 是相邻baseline之间的高度

  • vertical-align
    • 定义盒子所处的行盒(line box)的垂直对齐关系
    • 初始值baseline
    • 百分比相对于元素自身的行高
    • 取值:baseline | sub | super | top | text-top | middle | bottom | text-bottom |、<percentage> | <length>

  • 行级元素有baseline

    设置padding=0其子元素底部与行级元素底部也会有间距,

    要去掉间距可设置vertical-align属性or设置display:block;使其成为块级元素

  • list-style

    • list-style-type 种类超多的
    • list--style-position
    • list-style-image
  • background-repeat round | space (这两个参数尽量整数个)

  • background-position: x y ;

  • background-size:200px 100px ;

  • border-radius:30px/20px;两边弧度不一样

  • box-shadow:1px 3px 5px 0 rgba(20,20,20,0.6),...可设置无限多个阴影