美文网首页
position定位

position定位

作者: HonGz | 来源:发表于2019-08-29 18:59 被阅读0次
4.position的值有哪些?分别是相对于什么定位?
  • static
  • relative
  • absolute
  • fixed
  • inherit

static:默认值。没有定位,元素出现在正常的流中(忽略 top, bottom, left, right 或者 z-index 声明)。

relative:相对于其正常位置进行定位。

absolute:如果其父元素设置了定位则根据父元素,如父元素没设置,则根据body进行定位。

inherit:从父元素继承 position 属性的值。

相关文章

网友评论

      本文标题:position定位

      本文链接:https://www.haomeiwen.com/subject/bljwectx.html