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

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

WBOY
Release: 2016-06-24 11:28:58
Original
3233 people have browsed it


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


回复讨论(解决方案)

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>
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template