HTML/路徑:修訂版本之間的差異

出自六年制學程
跳轉到: 導覽搜尋
圖例
圖例
第 17 行: 第 17 行:
 
====圖例====
 
====圖例====
 
<table class=nicetable>
 
<table class=nicetable>
<tr><td style='background-color:pink'>文件根資料夾
+
<tr><td colspan=2 style='background-color:pink'>文件根資料夾
<tr><td>
+
<tr>
 +
<td>
  
  
第 24 行: 第 25 行:
  
  
</td></tr></table>
+
</td>
 +
<td>
 +
 
 +
 
 +
 
 +
 
 +
 
 +
</td>
 +
</tr>
 +
</table>

2014年2月14日 (五) 12:03的修訂版本

用於 img 的 src 屬性,以及 a 的 href 屬性。

  • 資料夾分層用「/」半型右上左下斜線隔開。
  • 相對路徑
    1. 不寫路徑,只寫檔名,代表和這個 html 同資料夾(同路徑)
    2. 「.」代表目前的資料夾(路徑),也就是這個 html 所在的資料夾(路徑),寫作「./」
    3. 「..」代表上一層資料夾(路徑),寫作「../」
    4. 上一層資料夾的再上一層資料用「../../」表示,依此類推。
  • 絕對路徑
    1. 同網站路徑:以「/」做為路徑的開頭,代表網站的「根目錄」
    2. 其他網站的檔名:如「http://xxxx/yyyy/zzzz/abc.jpg」

使用時機

相對路徑絕對路徑
本機
其他機器不可

圖例

文件根資料夾