我将我的样式表链接到我的基本 html 文件。
<title> <link rel="stylesheet" type="text/css" href="style.css">
当我点击转到链接时,它会转到正确的文件。我可以更改背景颜色和所有其他边距。但是当我插入一个 url 时,css 似乎找到了图片,但没有加载到 html,如果我单击预览,则没有图像加载。
picture {
width: 984px;
height: 148px;
background-image:url(img/header.jpg/);
最佳答案
在 header 标签下链接你的 css 而不是 title 标签,因为 title 标签指的是网站标题。
<header>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</header>
以及评论中提到的拼写错误,并确保您的目的地是正确的。]
p/s(打字错误)
picture{
background-image:url(img/header.jpg);
}
关于java - css 找到图像但无法将它们加载到预览中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18586219/