css # wrapper background-image未显示

unftdfkk  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(113)

我想在div# Package 器中显示一个图像,但除非我用文本填充相应div之后的区域,否则它不会显示。
我在# Package 器中有overflow:auto;,因为我在后续的div中有浮点数。
CSS文件:

@media only screen and (min-width: 25em) {
   html {
   background: url(images/gridbg.jpg) repeat fixed center top;
   }
}

@media only screen and (max-width:25em) {
    html {
    background-color:#0c0c1f;
    }
}

img {
    border:0px;
}

textarea:focus, input:focus{
    outline: none;
}

#wrapper {
    margin:0 auto;
    width:60em;
    overflow:auto;
    background-image:url(images/cont-bg.png);
}

#content {
    text-align:justify;
    position:fixed;
    width:59em;
    height:100%;
    overflow:auto;
    padding-top: 0.4em;
    padding-bottom: 0.4em;
    padding-left: 0.4em;
    padding-right: 0.4em;
    outline:none;
    z-index:2;
    margin-top:12em;
}

#homeNav {
    position:fixed;
    float:left;
    margin-left:0.65em;
    margin-top:0.65em;
    z-index:3;
}

#primaryNav {
    z-index:2;
    float:right;
    margin-left:28em;
    margin-top:1em;
    position:fixed;
}

#navGFX {
    background-image:url(images/navGFX.png);
    background-repeat:no-repeat;
    width:60em;
    height:8em;
    float:left;
    position:fixed;
    z-index:1;
    margin-top:3em;
}

字符串
HTML文件:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Ag Design</title>
<link href="main.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="scrollstyles.css"/>

<script type='text/javascript' src="js/flexcroll.js"></script>
</head>

<body>
<div id="wrapper">

<div id="navGFX">
<div id="homeNav"><a href="index.html"><img src="images/buttons/btn_logo.png"></a></div>
<div id="primaryNav">
<a href="index.html"><img src="images/buttons/btn_home.png"></a>
<a href="index.html"><img src="images/buttons/btn_link1.png"></a>
<a href="index.html"><img src="images/buttons/btn_link2.png"></a>
<a href="index.html"><img src="images/buttons/btn_link3.png"></a>
<a href="index.html"><img src="images/buttons/btn_link4.png"></a>
</div>
</div>

<div id="content" class="flexcroll">
This area is full of filler text
</div>
</div>
</body>
</html>


我不知道我做错了什么。有人有什么想法吗?

kiayqfof

kiayqfof1#

删除CSS:

position: fixed;

字符串
#wrapper id和背景图像将出现

相关问题