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.
我在某处读到可以在任何子目录的任何页面上添加 href="./" 以将用户发送到根 index.html 文件,但这似乎不起作用。正如标题所示,当用户单击主页链接时,我试图在 URL 中不包含 /index.html
然后只需使用:
<a href="/">home</a>
或者
<a href="/index.html">home</a>
如果你在 www.yoursite.com/dir/ 并且你想去你的根文件夹,你必须使用../而不是./
../
./
如果您想从 www.yoursite.com/dir/dir2/dir3/ 返回到您的根目录,您必须编写:../../../ 最好的解决方案可能是您的根文件夹的完整路径: www.yoursite.com/
../../../
www.yoursite.com/