HTML thorough dissection (9) Link mark

Source: Internet
Author: User
Tags add define end i18n 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

Usage: Used to define links and anchors (anchors)
Start/End Identification: must/must
Properties:%coreattrs,%i18n,%events
Charset= "..." denotes the encoded character of a resource
Name= "..." Defines an anchor
Href= "..." indicates the URL of the link source
Target= "..." determines where the source of the link is displayed (user-defined name, _blank,_parent,_self,_top)
Rel= "..." Send the type of link
Rev= "..." to save the type of link
Accesskey= "..." Specifies the hotkey for this element
Shape= "..." allows us to define a graphical image of the client using defined shapes (default,rect,circle,poly)
Coord= "..." to define the size of a shape using pixels or a percentage of length
Tabindex= "..." Use the defined TabIndex element to set the focus order between the elements (using the TAB key to get the element focus)
Null: Not Allowed

<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> <a href=" Http://www.webjx.com/htmldata/2005-05-03/1115116260.html#there ">& Lt;/a> where there is the reference point and needs to be preceded by a symbol # for recognition, the reference point is buried in the file in advance of 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.webjx.com> Web page Teaching network </A>
Font color= "#0052a4" ><p> <a href=http://www.webjx.com>
</A>
<P> Font color= "#008000" ><a href=http://www.webjx.com>
</A>
Show results Web Teaching Network

Example two (internal link): Please go to the label A to experience what is the internal link.

Original code <a name= "test" ></a>
<a href= "#test" > internal links to this page </a>
<br> <a href= "http://www.webjx.com/help.html#14" > skip to penpal Garden FAQ section </a>
Show results internal links on this page
Skip to section A of the label on this page

 
<BASE>: ▲top

Usage: The URL of all other link sources in the document that cannot be identified by the site
Start/End identification: mandatory/illegal
Properties:%coreattrs,%i18n,%events
Href= "..." indicates the URL of the link source
Target= "..." determines where the link source is displayed (_blank,_parent,_self,_top)
Null: Allow
Note: This element should be located within the head of the document

<BASE> is a linked 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>.

<BASE> general parameter setting:

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

  • href = "http:// www.microsoft.com/
    Sets the default path for all HTTP files and pictures in the Web page (including and graphical indicators), and others such as FTP ://And gopher://will not be affected. 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 markers are defaults to the directory where the page is located as a starting point, and 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>, then it will not link to its own directory index.html, it will link to the home page of Microsoft, because the relative path has been turned to <BASE> Absolute.

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

Example, and so on, you can go to some of the frames of the Web page to get a checkup.



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.