HTML LINK Tag

Source: Internet
Author: User
Tags add net reference relative window
Link

Link Markers

<A>
<BASE>

To understand this "HTML thorough analysis" of the mark classification, please see " Mark List ".
Please also understand the distinction between containment and empty tags, see "HTML concept ."

<A>: ▲top

<A> said link marks, by <A> and </A> surround the text, pictures and so on can become a link.

General parameter setting of <A>:

For example <a href= "index.html" name= "Hello" target= "_top" >

  • href= "index.html"
    This parameter cannot be used in conjunction with another parameter name to make a link that can be pressed.

    • when linked as an outer link: href sets the name of the file to which the link is linked, and if the file is not in the same directory as the HTML document, add the appropriate path, which is relatively absolute.

    • When as an inner link: href sets the reference point of the same file or specified file that the link is to be connected to, and does not need to include any content just add the end tag </a> it can, for example <a href= "# There "></a> , <a href=" index.html
      #there "></a> and <a href=" Http://www.school.net.hk/~chris55
      /index.html#there "></a> where the There is the reference point and needs to be preceded by a symbol # for recognition, the reference point is buried in the file prior to the next parameter name.

  • name= "Hello"
    This parameter is to bury the reference point for the file, as being linked, will not be displayed. So to make a wind link you need to use two times <A> link tags. One uses the parameter name to bury the reference point in the file beforehand, and the other uses parameter href to link to this reference point.

  • Target= "_top"
    Sets the window to be displayed when the link is pressed. The optional values are: _blank, _parent, _self, _top, frame name .

    • target= "frame name"
      This applies only to frames pages, and if set, the link results are displayed in the Frame Name box window, which is named in advance by the frame tag.
    • target= "_blank" or target= "new"
      Opens the content of the link in a new browser window.
    • target= "_parent"
      Treats the linked content as the previous screen of the file.
    • target= "_self"
      Displays the contents of the link in the current window. (default value)
    • target= "_top"
      Displays the contents of the linked screen in the frame in a window without frames. (that is, the frame is removed)

Example one: (external link)

original code < Font color= "#008000" ><a href= "http://www.fortuneage.com" Times Fortune Company </a>
<p> <a href= "http://www.goEway.com" >
</A>
<p> <a href= "http://www.goEway.com"
</A>
Show results Times Fortune Corp.

Example two (internal link): Please go to penpal Garden FAQ Page to experience what internal links are.

Original code <a name= "test" ></a>
<a href= "#test" > internal links to this page </a>
<br> <a href= "http://www.school.net.hk/~chi/faq.html#14" > skip to penpal Garden FAQ section </a>
Show results internal links on this page
Skip to the FAQ section of Penpal Garden

<BASE>: ▲top

<BASE> is a link datum tag that changes the default values for all link markers in a file. It can only be adapted to the beginning of a file, that is, between Mark <HEAD> and </HEAD>.

General parameter setting of <BASE>:

For example <base href= "http://www.microsoft.com/" target= "_top" >

    • href= "http://www.microsoft.com/"
      Sets the default path for all HTTP files and pictures (including relative path links and graphical indicators) on the Web page, and others such as ftp://and gopher://are unaffected. This parameter can only be filled in a relative or absolute path, without having to fill in the file name. General relative path links and graphical indicators are defaults to the directory where the page is located as a starting point, in this case, all links in the file will be http://www.microsoft.com/as a starting point, if there are links such as < A href= "index.html" >back to Main page</a>, it is not linked to the index.html of its own directory, it will link to the homepage of Microsoft, because the relative path has been given to <base > Turn it into absolute.

    • Target= "_top"
      Set the window to display the results of all links in the page, lest you add the target parameter to all the links, which are often applied to the frame. The setting is the same as the target parameter in the <A> link.

examples, and so on later, you can go to some of the frames made of the Web page to go to a physical examination.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.