CSS更改显示在eclipse中,但不显示在浏览器上

时间:2017-07-29 08:32:55

标签: html css eclipse web directory

我有一个index.html文件和index.css。目录结构是: img of directory structure

我将css链接到html:link rel="stylesheet" type="text.css" href="css/index.css"

我正在使用tomcat v8.5来托管。当我在服务器上运行我的项目时,我在eclipse的窗口中看到了这个: browser displayed within eclipse

然而,当我打开chrome / firefox并进行搜索时,它只是拉动index.html并且没有显示css:(

我读过必须使用" relative path"指定文件,但是,包含index.css的文件夹与index.html位于同一目录(WebContent)中。那么href =" css / index.css"的问题是什么? ?有人可以帮我解决路径问题吗?

非常感谢您的时间!

1 个答案:

答案 0 :(得分:0)

链接标记中有轻微错误。将type =“text.css”替换为type =“text / css”:

<link rel="stylesheet" type="text/css" href="css/index.css">
相关问题