Html 图像悬停不';行不通

Html 图像悬停不';行不通,html,css,Html,Css,我想在表格单元格中设置图像,此图像应通过悬停操作进行更改 css文件: #image_background { background-image: url(images/panorami_gallery.jpg); background-repeat: no-repeat; ... } .left_button { background-image: url (images/left_gallery_arrow.png); background-rep

我想在表格单元格中设置图像,此图像应通过悬停操作进行更改

css文件:

#image_background  { background-image: url(images/panorami_gallery.jpg);
          background-repeat: no-repeat;
...
}

.left_button { background-image: url (images/left_gallery_arrow.png);
          background-repeat: no-repeat;
}
.left_button:hover { background-image: url (images/left_gallery_arrow_hover.png);
           background-repeat: no-repeat; 
}
html文件:

<table id="background_image">
....
    <tr>
       <td>
          <div class ="left_button">
          </div>
       </td>
    </tr>
</table>

....

问题是我根本看不到“left_gallery_arrow.png”图像。我错过了什么?谢谢。

您可以尝试使用“url('link');”

div没有内容,也没有明确的高度或宽度。没有用于绘制背景图像的像素集合。

url和大括号之间不能有空格<代码>url(…)错误<代码>url()正确。(无论如何,Chrome+Ubuntu)

参见我的示例:

div需要一个height和width属性来显示图像。。或内容


另外,我假设“图像”背景是用来参考表格的。。。打字错误应该是
#背景图像

引号是可选的。使用单引号实际上会破坏IE5/Mac的功能……这并不是说现在的浏览器很重要。@Quentin好吧,你看,我不仅在那里加了引号,而且在url和大括号之间加了条带。。。正如你所看到的,这是不正确的。无论如何,谢谢你的否决票,这说明了为什么区别答案不是很好。嗨,昆汀,我把它改成了,但我仍然有一个bug。也许箭头图像不在表格背景图像的前面?谢谢链接,我不知道有类似的东西存在。我应该学习使用它,它看起来不错。