Home  >  Article  >  Web Front-end  >  怎样让下面的图片覆盖在上面的图片?_html/css_WEB-ITnose

怎样让下面的图片覆盖在上面的图片?_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:28:583166browse


这样两张图片 我怎样让下面那张上来 ,覆盖下拉框的那张图片?


回复讨论(解决方案)

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>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn