Java css查找图像,但无法将其加载到预览中
我将样式表链接到我的基本html文件。Java css查找图像,但无法将其加载到预览中,java,jquery,html,css,image,Java,Jquery,Html,Css,Image,我将样式表链接到我的基本html文件。 <title> <link rel="stylesheet" type="text/css" href="style.css"> 链接你的css在标题标签下,而不是标题标签,因为标题标签指的是网站标题 <title> <link rel="stylesheet" type="text/css" href="style.css"> <header> <title><
<title> <link rel="stylesheet" type="text/css" href="style.css">
链接你的css在标题标签下,而不是标题标签,因为标题标签指的是网站标题
<title> <link rel="stylesheet" type="text/css" href="style.css">
<header>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</header>
如下所示,在
html
<title> <link rel="stylesheet" type="text/css" href="style.css">
HTML
<title> <link rel="stylesheet" type="text/css" href="style.css">
<!DOCTYPE html>
<html lang="en">
<head>
<title>TEST</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="etbplaza.nl/css/style_basic.css"; />
</head>
<body>
<div class="picture"> your code hre </div>
</body>
</html>
这可能是一个输入错误:
<title> <link rel="stylesheet" type="text/css" href="style.css">
picture {
width: 984px;
height: 148px;
background-image:url(img/header.jpg/);
图片没有可能导致问题的类或id选择器和/或可能尝试使用url('img/header.jpg')代码>在引号内。或者url('../img/header.jpg')
但我们不知道图像的位置
<title> <link rel="stylesheet" type="text/css" href="style.css">
还可以尝试以下方法:
<title> <link rel="stylesheet" type="text/css" href="style.css">
检查元件
将鼠标悬停在路径上,查看是否存在正在加载的路径(如果是)
你的图像会显示在那里
更改背景图像:url(img/header.jpg/)
到背景图像:url(img/header.jpg)
还要确保/path/to/file
是正确的,如果picture是一个div类,那么它将像css中的.picture
一样什么是picture?类还是id?如果您提供了项目的HTML代码和文件夹结构,这会有所帮助。无论如何,您可能会在“img/header.jpg/”中输入错误。尝试删除结尾的额外斜杠。您的CSS文件是否在“CSS”子目录中?然后您必须将URL设置为。/img/header.jpg
,因为它必须与CSS文件相关。当然还有之前的另外两条评论。这不是打字错误。css文件与html文件位于同一地图中,它不是css文件,因为如果我将鼠标悬停在url(img/header/jpg)上,我可以看到图片。这真的很奇怪,因为我可以更改div的背景颜色,但我无法将图片放入其中。现在只有图片加载。更好,但是你能解释一下打字错误在哪里吗?#leftcol_bottom{背景图片:url(/img/leftcol_bottom.png);背景重复:不重复;宽度:220px;高度:13px;页边距底部:13px;这是一个输入错误。现在图片加载了。但其余的没有。这只是链接div的另一个示例。这一个也有问题吗,因为如果我将鼠标悬停在上面,这个甚至没有链接到图像。输入错误是“/”header.jpg.header.jpg后面应该是您的文件类型,因此“/”后面会损坏文件名类型。“/”通常用于验证文件夹。对所有div进行所有更改,您应该显示所有图片。为什么要将html链接到网站?我使用localhost,因此正确的路由是/root/formaten/style.css
<title> <link rel="stylesheet" type="text/css" href="style.css">
you have to use the css as in the form of class or id and try the code as
.picture {
width: 984px;
height: 148px;
background-image:url(img/header.jpg);
}
or as id
#picture {
width: 984px;
height: 148px;
background-image:url(img/header.jpg);
}
surly you got the preview of the Image to your HTML page.
Please check the path of css file is correct or not.