所以我使用CSS在一个div中添加了一个背景图像。
.aboutUs {
background-repeat: no-repeat;
position: relative;
background-image: url(public/images/team.png);
text-align: center;
background-size: cover;
height: 310px;
margin: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
padding-top: 20px;
border-bottom-left-radius: 50%;
border-bottom-right-radius: 50%;
}
但是当我在localhost中打开它时,所有的图像(HTML格式)都显示出来了,但是div背景没有显示出来。
在我的控制台中,它给了我这个错误
如果你能帮上忙,我会非常感激的!。快乐编码!:d
也许试试这个?
background-image: url(./images/team.png);