我不明白为什么这张背景图片没有出现。看起来图像正在发送到浏览器,并且正在应用 css 规则。
当我检查元素时,我得到了这些匹配的规则。当我点击“images/o.png”链接时,它会显示预期的图像 .player1_move { 宽度:30px; 高度:30px; 背景图片:url('images/o.png');
------------ 下面是我的css和html ----------
.player1_move {
width: 30px;
height: 30px;
background-image: url('images/o.png');
}
<table>
<tr>
<td id = "0-0" class="player1_move"></td>
</tr>
</table>
最佳答案
我猜你的单元格是空的,这就是它没有显示的原因。
将此添加到您的 CSS 中:
table{
empty-cells: show;
}
关于html - css 背景图片不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8024631/