【问题标题】:CSS changes shows up in eclipse but not on browserCSS 更改显示在 Eclipse 中,但不在浏览器中
【发布时间】:2018-01-05 07:56:00
【问题描述】:

我有一个 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 :(

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

非常感谢您的宝贵时间!

【问题讨论】:

    标签: html css eclipse web directory


    【解决方案1】:

    链接标签有一个小错误。将 type="text.css" 替换为 type="text/css":

    <link rel="stylesheet" type="text/css" href="css/index.css">
    

    【讨论】:

    • 好的,所以“type=" 指定链接是一个文本文档,在这种情况下,它包含 css。如果我在这里错了,请纠正我。如果没有,谢谢您的时间! :)
    猜你喜欢
    • 2019-11-02
    • 1970-01-01
    • 1970-01-01
    • 2013-08-13
    • 2023-04-06
    • 2014-11-13
    • 1970-01-01
    • 2019-06-03
    • 1970-01-01
    相关资源
    最近更新 更多