簡體   English   中英

簡單的CSS z-index示例不起作用

[英]Simple CSS z-index example not working

我正在嘗試在z-index上制作一個帶有兩個圖像的簡單html:

<html>
    <head>
        <title>test</title>
        <style type="text/css">
            back {
                position: absolute;
                left: 0px;
                top:0px;
                z-index:0;
            }

            front {
                position: absolute;
                left: 0px;
                top:0px;
                z-index:1;
            }
        </style>
    </head>
    <body>
        <img id="front" src="loading.gif">
        <img id="back" src="plasma.jpg">
    </body>
<html>

但是為什么Z索引不起作用?

您忘記在CSS中的ID之前添加#

#back { ... }
#front { ... }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM