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