posts - 262,  comments - 221,  trackbacks - 0
          資料來源:www.w3cschools.com

          一、HTML中的href屬性:

          The <a> tag is used to create an anchor to link from, the href attribute is used to address the document to link to, and the words between the open and close of the anchor tag will be displayed as a hyperlink.

          <a >Visit W3Schools!</a>

          備注:
          1). 像href=” 2). 如果href屬性的值以/開頭,則表示相對于服務器的根目錄,如果沒有則表示相對于當前頁面

          二、HTML中的target屬性:

          With the target attribute, you can define where the linked document will be opened.

          <a href="

          三、HTML中的name屬性:

          The name attribute is used to create a named anchor. When using named anchors we can create links that can jump directly into a specific section on a page, instead of letting the user scroll around to find what he/she is looking for.

          You should notice that a named anchor is not displayed in a special way.To link directly to the "tips" section, add a # sign and the name of the anchor to the end of a URL.

          <a name="tips">Useful Tips Section</a>

          備注:
          一個被錨標記標注的文本并不會有什么特別的顯示,要想使用錨標記進行頁間跳轉,只需要在URL的末尾加上一個#號和錨標記的名稱就可以了。如果是進行頁內跳轉則簡單地使用#號加錨標記的名稱就可以了(連URL都不用了)。

          <a >
              Jump to the Useful Tips Section
          </a>

          <a href="#tips">Jump to the Useful Tips Section</a>

          四、關于超鏈接的一些注意點:

          Always add a trailing slash to subfolder references. If you link like this: , you will generate two HTTP requests to the server, because the server will add a slash to the address and create a new request like this:

          Named anchors are often used to create "table of contents" at the beginning of a large document. Each chapter within the document is given a named anchor, and links to each of these anchors are put at the top of the document.

          If a browser cannot find a named anchor that has been specified, it goes to the top of the document. No error occurs.



          -------------------------------------------------------------
          生活就像打牌,不是要抓一手好牌,而是要盡力打好一手爛牌。
          <2008年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(21)

          隨筆分類

          隨筆檔案

          BlogJava熱點博客

          好友博客

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 寿阳县| 吕梁市| 义马市| 会理县| 三台县| 闵行区| 合阳县| 晋中市| 新田县| 凌海市| 孝感市| 北流市| 九龙坡区| 特克斯县| 巴林左旗| 镇平县| 屏南县| 海安县| 肥乡县| 通化市| 莫力| 东城区| 弥渡县| 衡阳市| 阿荣旗| 建水县| 凤台县| 靖边县| 武平县| 民乐县| 闽侯县| 云安县| 金秀| 象山县| 上思县| 雅江县| 大荔县| 宽甸| 城市| 饶河县| 额济纳旗|