css -position

  • static:默认设置,使用正常的布局行为,即元素在文档常规流中当前的布局位置。此时 top, right, bottom, left 和 z-index 属性无效。
  • relative:相对定位,这时没有脱离文件流,他的位置也不会被取代,这时的top, right, bottom, left是针对其原始默认位置
  • absolute:绝对定位,这时已经脱离文件流,他的top, right, bottom, left相对于最近的非 static 祖先元素定位

猜你喜欢

转载自blog.csdn.net/tinpo_123/article/details/83759155