如
/xxx/xxx
<a href="/xx/xxx/" ></a>
如上,这样的路径对服务器来说/为网站根目录 即网站访问时的首页
如
www.demo.com
/app.php
<img src="/2.jpg" />
此时图片就在web服务器的根目录
www.demo.com/2.jpg
其实路径还可以写成网路路径或本地磁盘路径
如
<a href="http://www.demo.com/demo.gif"></a>
windows <a href="c:\www\2.jpg"></a>
linux <a href="/home/xxx/images/2.jpg"></a>
相对路径
<a hef="../xx/2.jpg"></a>
.. 两点代表回到上级目录
. 一点代表当前目录
如
<a href="./xx/2.jpg"></a>
../../../
往上会3层,即退三步