让一个层在所有层的下面当背景的方法:z-index:-1
要让z-index的值小于0
<html>
<head>
<style type=\"text/css\">
img
{
position:absolute;
left:0px;
top:0px;
z-index:-1;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<img src=\"/i/eg_smile.gif\" />
<p>由于图像的 z-index 是 -1,因此它在文本的后面出现。</p>
</body>
</html>
本文地址:https://www.stayed.cn/item/20995
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我