drelgkxl93433 2017-05-02 05:42
浏览 100

前往:HTML找不到CSS档案

So i'm writing a web application in Golang. The html references a css file like so: <link href="/css/index.css"..., but the css file is never found!.

Here is the bummer though, i have a couple of css files and they are all in the same folder, and they all work!.

If i create another css file and name it index2.css and copy the contents of index.css into index2.css, this works perfectly, but for some reason, the name index.css does not work!

Also, when i go to the link http://localhost:8080/css/ this list all my css files. If i click on any of them, it opens up perfectly except index.css; i get a 404 not found.

This is really strange, any idea what could be the problem?

All files in css folder:

enter image description here

index.css not found:

enter image description here

<head>
    <title>Title</title>
    <link href="/css/index2.css" rel="stylesheet" type="text/css" media="screen"/>
    <link rel="icon" type="image/png" href="/images/img.png"/>
    <script src="/scripts/jquery.min.js"></script>
    <script src="/scripts/scroll.js"></script>
</head>

When i like to <link href="/css/index2.css" rel="stylesheet"... i can see the css style on my page. When i link to <link href="/css/index.css" rel="stylesheet"... i can't.

index.css exists in my folder:

enter image description here

EDIT

It works now. I think it was a permission issue. I deleted the old index.css and created a new one and it works now. Thanks for the help.

  • 写回答

2条回答

  • dongzhi6463 2017-05-02 06:31
    关注

    May be this problem is because of -

    1.Temp file, try to find index.css~ file.If using Ubuntu then go to the css folder and press ctrl+H. then you will see the temp file if it is there.

    2.May be path is not correct.

    3.May be file got corrupted, try to delete and create new index.css

    4.Provide your source code to debug your issue.

    评论

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 虚心请教几个问题,小生先有礼了
  • ¥30 截图中的mathematics程序转换成matlab