力“位置:绝对”相对于文档而不是父容器 [英] force "position: absolute" to be relative to document not parent container
本文介绍了力“位置:绝对”相对于文档而不是父容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在主体的任何部分插入一个div,并且相对于整个文档使其position:absolute,而不是具有position:relative的父元素。
$ b $您必须将 div
放置在位置之外:相对于
元素和 body
。
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".
解决方案 You will have to place the div
outside of the position:relative
element and into body
.
这篇关于力“位置:绝对”相对于文档而不是父容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文