笔记:css中的position定位

时间:2019-03-11 21:51:30   收藏:0   阅读:177

position的值可以是:static,relative,absolute,fixed。

 

默认值是 static。设置 left、top值无效。

 

relative是相对定位,可以设置left、top、bottom、right值,它设相对本来的位置偏移。

 

absolute是绝对定位,可以设置left、top、bottom、right值,默认是相对整个网页,如果它的父元素是relative定位,则会相对父元素定位。

 

fixed设置left、top、bottom、right值,会将元素固定在屏幕上的某个位置,无论屏幕怎么滚动,它都在那里。

原文:https://www.cnblogs.com/mafengzi/p/10513400.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!