html - 背景图像未显示在 <div> 容器中

标签 html css image sprite

我有一个愚蠢的小问题。看起来 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/

相关文章:

html - 图像结束后水平对齐新的文本行

image - 在图片中创建一个钻石

html - 跨多行包装标记时如何避免空格

javascript - 在将数据推送到模板时使链接可点击

html - 如何在使用不同的行高时创建一致的垂直间距?

javascript - Facebook评论框位置

iphone - AVASSETWriterInput 用于从 Iphone 问题上的图像制作视频

php - 允许特定文件类型?上传

html - 输入字段未在表单内联或表单水平对齐

css - 是否有另一种方法在 css 中选择这些节点