如何在html中控制div重叠 [英] how to control div overlapping in html

查看:217
本文介绍了如何在html中控制div重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个网页,并且我有两个'div,例如A和B.
现在A的位置是'fixed',它位于页面顶部,但B的位置是'绝对',位于页面中间的某个位置。当它们重叠时,B出现在A之上,但我希望这是另一种方式。我希望A能够超越任何事物,但我不知道该怎么做。

请注意,改变他们的位置不是一个选择。

>

预先感谢您。 :)

解决方案

使用z-index值将它们相应地调整为图层。
其风格属性:style =z-index:200....


I am creating a webpage, And I have two 'div's, A and B for instance. Now 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.

Thank You in advance. :)

解决方案

use z-index value to adjust them accordingly to layer. its a style property: style="z-index:200"....

这篇关于如何在html中控制div重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆