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

前端技术 2023/09/08 CSS
让一个层在所有层的下面当背景的方法: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

转载请注明出处。

本站部分内容来源于网络,如侵犯到您的权益,请 联系我

我的博客

人生若只如初见,何事秋风悲画扇。