1

请帮忙!我无法让它工作,我不明白为什么。

这是一个简单的代码,但它只是不工作。

我希望 folder_image.png 出现在 folder.png 下,仅此而已!非常感谢!!!

<!DOCTYPE html>
<html>
<head>
    <style>
    .container {
        width:  136px;
        height: 201px;
        background: url(http://s-ola.me/img/folder.png) no-repeat;
        z-index: 2;
                    position:relative;
    }

    .folder {
        width:  136px;
        height: 101px;
        background: url(http://s-ola.me/img/folder_image.png) no-repeat;
        z-index: 1;
                    position:relative;
    }

    .text {

    }
    </style>
</head>
<body>
    <div class="container">
    <div class="folder"></div>
    <div class="text">text</div>
    </div>

</body>

</html>
4

2 回答 2

0

I made this solution but i dont like it. It didnt answered on my question.

<html>
<head>
    <style>

    #test{z-index:-10; position:relative;}
    .container {
        width:  136px;
        height: 201px;
        background: url(http://s-ola.me/img/folder.png) no-repeat;
        position: relative;
        margin:0 auto;
    }

     .folder {
        width:  136px;
        height: 101px;
        background: url(http://s-ola.me/img/folder_image.png) no-repeat;
        z-index:-1;
        position:relative;
    }
    .text {
 margin:0 auto;
 position:relative;
 margin-left:40px;
    }
    </style>
</head>
<body>
<div id="test">
    <div class="container">
        <div class="folder"></div>
        <div class="text">text</div>
    </div>
    </div>
</body>
 </html>
于 2013-01-27T23:41:53.517 回答
0

把这个

<div class="folder" style="{z-index: 2};">

并将其从 CSS 中取出

于 2013-01-27T22:32:55.093 回答