../表示源文件所在目录的上一级目录,../../表示源文件所在目录的上上级目录,以此类推。
假设info.html路径是:c:/Inetpub/wwwroot/sites/blabla/info.html
假设index.html路径是:c:/Inetpub/wwwroot/sites/index.html
在info.html加入index.html超链接的代码应该这样写:
<a href="../index.html">index.html
假设info.html路径是:c:/Inetpub/wwwroot/sites/blabla/info.html
假设index.html路径是:c:/Inetpub/wwwroot/index.html
在info.html加入index.html超链接的代码应该这样写.
<a href="../../index.html">index.html
假设info.html路径是:c:/Inetpub/wwwroot/sites/blabla/info.html
假设index.html路径是:c:/Inetpub/wwwroot/sites/wowstory/index.html
html路径是:c:/Inetpub/wwwroot/sites.
在info.html加入index.html超链接的代码应该这样写:
index.html
如何表示下级目录
引用下级目录的文件,直接写下级目录文件的路径即可。
假设info.html路径是:c:/Inetpub/wwwroot/sites/blabla/info.html
假设index.html路径是:c:/Inetpub/wwwroot/sites/blabla/html/index.html
在info.html加入index.html超链接的代码应该这样写:
index.html
假设info.html路径是:c:/Inetpub/wwwroot/sites/blabla/info.html
假设index.html路径是:c:/Inetpub/wwwroot/sites/blabla/html/tutorials/index.html
在info.html加入index.html超链接的代码应该这样写:
index.html
HTML绝对路径(Absolute Path)
HTML绝对路径(absolute path)指带域名的文件的完整路径。
表示源文件所在目录的上上级目录,以此类推。正确地引用文件,我们需要学习一下HTML路径。
假设你注册了域名www.blabla.cn,并申请了虚拟主机,你的虚拟主机提供商会给你一个目录,比如www,这个www就是你网站的根目录。
假设你在www根目录下放了一个文件index.html,这个文件的绝对路径就是: http://www.blabla.cn/index.html。
.html,这个文件的绝对路径就是http://www!
假设你在www根目录下建了一个目录叫html_tutorials,然后在该目录下放了一个文件index.html,这个文件的绝对路径就是http://www.blabla.cn/html_tutorials/index.html。