强制“位置:绝对"相对于文档而不是父容器 [英] Force "position: absolute" to be relative to the document and not the parent container
本文介绍了强制“位置:绝对"相对于文档而不是父容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图将div插入正文的任何部分,并使它的position: absolute
相对于整个文档,而不是相对于具有position: relative
的父元素.
I am trying to insert a div into any part of the body and make its position: absolute
relative to the whole document and not a parent element which has a position: relative
.
推荐答案
您将必须将div
放在position:relative
元素之外,并放入body
.
You will have to place the div
outside of the position:relative
element and into body
.
这篇关于强制“位置:绝对"相对于文档而不是父容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文