| 起始標籤 | 結束標籤 |
|---|---|
| 需要 | 不需要 |
<base /> 有兩個屬性 (attribute)
| 屬性 | 值 |
|---|---|
| href | 基本路徑 |
| target | _self _blank _parent _top |
href 用來設定基本路徑,例如
<base href="http://www.w3.org/TR/html401/" />
http://www.w3.org/TR/html401/ 為 W3C 放置 HTML 4.01 標準的規格文件網址, <base /> 的 href 屬性設定為網頁的連結起始點,例如
<a href="intro/intro.html"> 2. Introduction to HTML 4</a>
點擊 2. Introduction to HTML 4 便會連結到

我們寫成一份完整的 HTML 文件如下
<html>
<head>
<title>HTML 4.01 參考文件</title>
<base href="http://www.w3.org/TR/html401/" />
</head>
<body>
<a href="">HTML 4.01 Specification</a>
<ul>
<li>
<a href="about.html">
1. About the HTML 4 Specification</a>
</li>
<li>
<a href="intro/intro.html">
2. Introduction to HTML 4</a>
</li>
<li>
<a href="sgmltut.html">
3. On SGML and HTML</a>
</li>
<li>
<a href="conform.html">
4. Conformance: requirements and recommendations</a>
</li>
<li>
<a href="charset.html">
5. HTML Document Representation</a>
</li>
<li>
<a href="types.html">
6. Basic HTML data types</a>
</li>
<li>
<a href="struct/global.html">
7. The global structure of an HTML document</a>
</li>
<li>
<a href="struct/dirlang.html">
8. Language information and text direction</a>
</li>
<li>
<a href="struct/text.html">
9. Text</a>
</li>
<li>
<a href="struct/lists.html">
10. Lists</a>
</li>
<li>
<a href="struct/tables.html">
11. Tables</a>
</li>
<li>
<a href="struct/links.html">
12. Links</a>
</li>
<li>
<a href="struct/objects.html">
13. Objects, Images, and Applets</a>
</li>
<li>
<a href="present/styles.html">
14. Style Sheets</a>
</li>
<li>
<a href="present/graphics.html">
15. Alignment, font styles, and horizontal rules</a>
</li>
<li>
<a href="present/frames.html">
16. Frames</a>
</li>
<li>
<a href="interact/forms.html">
17. Forms</a>
</li>
<li>
<a href="interact/scripts.html">
18. Scripts</a>
</li>
<li>
<a href="sgml/intro.html">
19. SGML reference information for HTML</a>
</li>
<li>
<a href="sgml/sgmldecl.html">
20. SGML Declaration of HTML 4</a>
</li>
<li>
<a href="sgml/dtd.html">
21. Document Type Definition</a>
</li>
<li>
<a href="sgml/loosedtd.html">
22. Transitional Document Type Definition</a>
</li>
<li>
<a href="sgml/framesetdtd.html">
23. Frameset Document Type Definition</a>
</li>
<li>
<a href="sgml/entities.html">
24. Character entity references in HTML 4</a>
</li>
<li>
<a href="appendix/changes.html">
Appendix A: Changes</a>
</li>
<li>
<a href="appendix/notes.html">
Appendix B: Performance, Implementation, and Design Notes</a>
</li>
<li>
<a href="references.html">
References</a>
</li>
<li>
<a href="index/elements.html">
Index of Elements</a>
</li>
<li>
<a href="index/attributes.html">
Index of Attributes</a>
</li>
<li>
<a href="index/list.html">
Index</a>
</li>
</ul>
</body>
</html>
<!-- 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:example14.html
功能:示範 HTML 標記語言的使用
作者:張凱慶
時間:西元 2010 年 11 月 -->這份 HTML 文件以 http://www.w3.org/TR/html401/ 為基本路徑,所有超連結都是用相對路徑,簡單用瀏覽器 (broswer) 開啟如下

任點一個連結就會開啟 http://www.w3.org/TR/html401/ 的網頁

另一個屬性 target 為瀏覽器視窗開啟的模式,不做設定會在相同視窗中開啟,通常會做設定只會用到 _blank ,這具有新視窗或新分頁開啟的作用。
| 中英文術語對照 | |
|---|---|
| 標籤 | tag |
| 相對路徑 | relative path |
| 屬性 | attribute |
| 瀏覽器 | broswer |
您可以繼續參考
HTML 基本概念
- 元素與屬性
- 絕對路徑與相對路徑
- 度量與單位
- 網頁顏色
- 網頁字元索引
- 文件型態定義
- <html> - 文件標籤
- <head> - 文件標頭
- <title> - 標題
- <meta /> - 資訊
- <link /> - 外連樣式表
- <script> - 腳本程式
- <style> - 樣式
- <base> - 基本路徑
- <body> - 文件主體
- <address> - 作者資訊
相關目錄
HTML 4.01 快速導覽 - 目錄
HTML, CSS 教材
首頁
參考資料
沒有留言:
張貼留言