如何控制html中的`div`重叠 [英] How to control `div` overlapping in html
问题描述
我正在创建一个网页,并且我有两个div
,例如A和B.
A的位置为fixed
且位于页面顶部,而B的位置为absolute
且位于页面中间.当它们重叠时,B排在A的顶部,但是我希望这可以反过来.我希望A胜于一切,但我不知道该怎么做.
I am creating a webpage, And I have two div
s, A and B for instance.
A's position is fixed
and it's on top of the page, but B's position is absolute
and is somewhere in the middle of the page. When they Overlap, B comes on top of A, But I want this to be the other way around. I want A to come on top of anything, but I don't know how to do that.
请注意,更改其位置不是一种选择.
Please note that changing their positioning is not an option.
先谢谢您. :)
推荐答案
使用z-index值将其相应地调整为图层. 其样式属性:style ="z-index:200"....
use z-index value to adjust them accordingly to layer. its a style property: style="z-index:200"....
这篇关于如何控制html中的`div`重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!