HTML tag a tag

Source: Internet
Author: User

The syntax of a tag

<a href= "link Destination address" title= "comment" target= "open link Window" > Link display content </a>

Target value:

_blank opens in a new window;

_self opens in its own window (default);

_parent is opened in the previous window, the framework is often used;

_top opens in the entire browser window, ignoring any frames.

Ii. Types of links

1. Internal link (the current document is within the same site as the target document) <a href= "Destination document location and full name" ></a>;

2. External link (the current document is not in the same site as the destination document) <a href= "url" ></a>;

3.e-mail link (and allow visitors to send mail to a specified address) <a href= "mailto: E-mail Address" ></a>;

4. Anchor connection jumps to the same page or other document at the specified location: Create anchor, <a name= anchor name > Show content </a> link anchor point, <a href= (URL) #锚点名称 > Display content </a>;

5. An empty link is a link without a target endpoint, <a href= "#" > Display content </a>;

6. Script Link: is a special kind of link, you can run the corresponding JS statement when you click the text or image to set the script link.

Iii. Common Script Links

Close window: Enter Javascript:window.close ();

<a href= "Javascript:window.close (); > Close Window </a>

Open window: Enter Javascript:window.open (' filename or URL '); 

<a href = "Javascript:window.open (' filename or URL ');" > Open Window </a>

Iv. Advanced usage of links

①. Set Homepage: <a href= "#" onclick= "this.style.behavior= ' url (#default #homepage) '; this.sethomepage (' Destination URL ') > homepage </a>.

②. Add favorite: <a href= "#" onclick= "javascript:window.external.addfavorite (' Destination URL ', ' Favorite name ') ' > Add to Favorites </a>.  

HTML tag a tag

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.