Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以帮我解决这个目录问题。我有 index.php 页面并包含 header 和 footer.php 标头包含<link href="new.css"/>,new.css 位于主目录中。并且每次我尝试将 new.css 与主目录分开,就像css/new.css它在其他元素上效果不佳但如果我尝试将它放回主目录它工作正常。有人能告诉我为什么会这样吗?
<link href="new.css"/>
css/new.css
示例: 您有一个文件:http://mysite.com/blabla/blabla2/index.php 现在如果您使用:<link href="new.css"/>- 就像<link href="http://mysite.com/blabla/blabla2/new.css"/>
http://mysite.com/blabla/blabla2/index.php
<link href="http://mysite.com/blabla/blabla2/new.css"/>
所以你需要使用这个:<link href="css/new.css"/>
<link href="css/new.css"/>
尝试使用<link href="../css/new.css" />它可能会起作用。
<link href="../css/new.css" />