使用z-index:-1 让一个层在所有层的下面当背景

(编辑:jimmy 日期: 2024/9/22 浏览:2)

让一个层在所有层的下面当背景的方法: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="/UploadFiles/2021-03-30/eg_smile.gif"><p>由于图像的 z-index 是 -1,因此它在文本的后面出现。</p>
</body>
</html>