讓一個層在所有層的下面當背景的方法: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>
效果展示如下圖:
? 2012-2024七七建設 20707.net 版權所有 豫ICP備2022027209號