我有一个愚蠢的小问题。看起来 CSS 背景图像属性将不起作用。
图像在后面的 DIV 容器中,我认为它可能会干扰它,但在删除它之后,它仍然不起作用(当前已删除)
我已经尝试将 css 代码放在不同的类中,但它仍然不起作用
我已确保图像与 html 和 css 文件位于同一目录。
HTML
<div class="detail_below">
<div class="course-downloadPF">
<a class="thickbox" href="http://www.google.com">Project Files Included</a>
</div>
<div class="course-add2PL">
<a class="thickbox" href="http://www.google.com">Add Course <br />to Playlist</a>
</div>
<div class="course-add2Favorite noMargin">
<a class="thickbox" href="http://www.google.com">Add to <br />Favorite</a>
</div>
</div>
CSS
.course-downloadPF a,
.course-add2PL a,
.course-add2Favorite a,
.course-removeFavorite a {
width:80px;
height:40px;
font-size:11px;
color:#fff !important;
line-height:1.1em;
text-align:center;
text-decoration:none;
padding-top:40px;
background:url (sprite-courseDetails.gif) 0 0 no-repeat;
margin-right:10px;
display:block;
float:left;
border-radius: 4px;
}
.course-add2PL a {
background:url (sprite-courseDetails.gif) -80px 0 no-repeat;
}
.course-add2Favorite a {
background:url (sprite-courseDetails.gif) -160px 0 no-repeat;
}
.course-removeFavorite a {
background:url (sprite-courseDetails.gif) -240px 0 no-repeat;
}
如果有人可以看一下并给出第二个意见,我将不胜感激,因为我确信它是我忽略的一些小而愚蠢的东西。
最佳答案
好的,在你的 CSS 中,下面的样式没有右括号
.whiteCLR {
color: #fff; /* White */
可能会有更多错误,但修复那个错误,然后我们再看。
翅膀
关于html - 背景图像未显示在 <div> 容器中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15148692/