Parsing HTML Language (10) Link Markers

Source: Internet
Author: User
Tags net reference relative window
Link The
<A>
<BASE>
<A>:
<A> is called the link mark, by <A> and </A> surround the text, picture 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 with another parameter name in order to create a link that can be pressed.
    • when connected as an outer part: href Sets the name of the file to which the link is to be attached, and if the file is not in the same directory as the HTML document, add the appropriate path, which is relatively absolute.
    • When connected as an inner link: href sets the reference point of the same document or specified file that the link is to be connected to, and does not surround any calligraphy and painting with a closing mark </a> 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 there is the reference point and preceded by a symbol # for recognition, the reference point is given by the next parameter name prior to the text Pieces buried in it.

  • name= "Hello"
    This parameter is to bury the reference point for the file, as being linked, will not be displayed. So to create an internal link to use two times <A> link tag. One uses the parameter name to embed the reference point in the file beforehand, and the other uses the argument href to connect to the reference point.

  • Target= "_top"
    Sets the window to be displayed for the result of the link being pressed. Optional values are: _blank, _parent, _self, _top, box window name .

    • target= " box window name "
      This applies only to the frame, and if set, the link result will be displayed in the box window of the box window name, which is named in advance by the frame tag.
    • target= "_blank" or target= "new"
      will be linked to the content of the screen, open in the New browsing window.
    • target= "_parent"
      will link the screen content, as a file of the previous screen.
    • target= "_self"
      The contents of the linked screen are displayed 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= ". /promote/engines.html 450 Search engine </A>
<a href= "Http://www.hkseek.com/icq"
</a>
<P> <a href= "Http://www.hkseek.com/icq"
Show results 450 Search Engines

Example two (internal link): Please go to penpal Garden's FAQ Page to experience what an internal link is.

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

&NBSP;
<base> is a linked datum mark that changes the parameter defaults of all the link markers in the file. It can only be applied to the beginning of a file, that is, between Mark <HEAD> and </HEAD>.

General parameter settings for <BASE>:

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

  • href = "http://www.microsoft.com/"
    sets all HTTP files and graphics in the page page (including and graphical markers, and so on, 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 set as a starting point in the directory where the page is located, and if this is the 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>, then it will not be linked to the index.html of the directory, it would be connected to the Microsoft's home page, because the relative path has been <BASE> turned to absolute. The
  • target = "_top"
    sets the window to be displayed for all links in the page to be pressed, lest each link be added with the target parameter, which is often applied to the frame. The setting is the same as the target parameter in the <A> link tag. The

Example will be written later, and you can try it yourself or go to some Web pages that are made of frames.



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.