这样两张图片 我怎样让下面那张上来 ,覆盖下拉框的那张图片?
position设置下z-index的值就可以了,设置值越大层越高。。要注意的是需要在根级比较才行。。
如:
<div style="position:relative;z-index:2; width:500px; height:500px; background:red;">1</div> <div style="position:relative;z-index:1; top:-20px; background:blue; width:600px; height:300px"> <div style="position:relative;z-index:9999;">2</div> </div>
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号