我尝试了所有方法,包括更改文件夹、重命名、检查拼写错误。
我首先尝试将它添加到一个 css 类中
下面是我最后一次尝试在 HTML 表上尝试
<div> <nav class="Article">
<table>
<tr>
<td data-bg="Artboard-10.png">
</td>
</tr>
</table>
</nav>
</div>
<div>
正文背景图像工作正常,它只是试图将其他背景图像添加到元素中,因为表格或部分不起作用。
这是我最初添加的CSS代码
.Article table tr td{
background: url("Photos/Artboard-10.png") no-repeat;
请帮忙!
最佳答案
作为背景的图像。
.article .image {
background: url("https://images.pexels.com/photos/257540/pexels-photo-257540.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=300&w=200") center no-repeat;
width: 400px;
height: 267px;
}
<div>
<nav class="article">
<table>
<tr>
<td>
<div class="image">
 
</div>
</td>
</tr>
</table>
</nav>
</div>
<div>
关于css - 背景图片没有出现在我的网站上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51621776/