首页 > 其他 > 详细

position inherit 定位

时间:2018-05-23 11:35:50      阅读:264      评论:0      收藏:0      [点我收藏+]

inherit  继承父元素   定位

举例  :

<div class="father">

  <p></p>

</div>

div{

  position:fixed;

  left:0;

  top:0;

}

p{

  position:inherit;//继承了父元素的fixed;此时就会相对于浏览器定位;不会相对于父元素定位,阿懂?

  left:10000px;

  top:1000px;

}

position inherit 定位

原文:https://www.cnblogs.com/520BigBear/p/9075862.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!