我希望我的博客容器具有与整个页面分开的背景。但是,它以 wood.png 为背景,而不是 bg.png。我正在使用以下内容:
CSS
body {
background: url('img/bg.png') repeat;
}
.above {
background: url('img/wood.png') repeat;
width: 100%;
}
#blog-header {
background: url('img/wood.png') repeat;
height: 160px;
width: 100%;
text-align: center;
}
#blog-container {
background: url('img/bg.png') repeat;
margin: 0 auto;
width: 960px;
}
#blog {
float: left;
margin-top: 80px;
position: relative;
width: 620px;
}
HTML/PHP
<body>
<div class="above">
<div id="blog-header">
<div class="logo">
<a href="<?php bloginfo('url'); ?>"><img src="<?php echo get_template_directory_uri(); ?>/img/logo.png" alt="Urban Palate logo" id="logo" /></a>
</div><!-- end logo -->
<nav>
<ul>
<li><a href="/?page_id=7"><img src="<?php echo get_template_directory_uri(); ?>/img/about.png" alt="Urban Palate intro" /></a></li>
<li><a href="/?page_id=12"><img src="<?php echo get_template_directory_uri(); ?>/img/portfolio.png" alt="Urban Palate portfolio" /></a></li>
<li><a href="/?page_id=15"><img src="<?php echo get_template_directory_uri(); ?>/img/blog.png" alt="Urban Palate blog" /></a></li>
<li><a href="/?page_id=10"><img src="<?php echo get_template_directory_uri(); ?>/img/contact.png" alt="Urban Palate contact" /></a></li>
</ul>
</nav>
</div><!-- end blog-header -->
<div id="blog-container">
<div id="blog">
<div id="post">
//content
</div><!-- end post -->
</div><!-- end blog -->
</div><!-- end blog-container -->
任何想法可能导致问题?
预计到达时间:JSFiddle