<a> Tags are mainly used to define links and bookmarks, and are also called hyperlinks or anchor links. The most common uses are the following:
Create a hyperlink href attribute and jump to the link in the middle href=.<a href=https://www.VeVb.com/>www.VeVb.com</a>Create a bookmark, use the name or id attribute and the end of the hyperlink to add # and the name of this bookmark to jump to a certain location on the web page
<a name=top></a><a name=1></a><a name=2></a><a href=#top>Return to top</a><a href=#1>Open Chapter 1</a><a href=#2>Open Chapter 2</a>
When you open the online tutorial of Ewei Technology W3CSchool, the navigation below the title will appear, which are created through bookmark name.
Javascript event attributes, click to execute different commands<a href=javascript:void(0) onclick=this.href='https://www.VeVb.com/'>www.VeVb.com</a>
When there is no CSS style of the custom anchor link <a href=https://www.VeVb.com/> anchor link text</a>, the default anchor link styles are as follows:
The default link style is used, please use the mouse to trigger the effect.
<style type=text/css>
a{color:#00F}
a: visited{color:#800080}
a:hover{color:#F00}
</style>
<a href=https://www.VeVb.com/>www.VeVb.com</a>
a{color:#00F} The anchor links are all blue and underlined.
a: visited{color:#800080} The link after clicking is purple and underlined
a:hover{color:#F00} The mouse triggers the red and underlined styles
However, because these three colors are too strong, they often cannot match all web design styles. If you need anchor link styles for other colors, you only need to modify the color and background by yourself in CSS according to the above three styles.
In fact, when HTML was first launched, the browser was not as advanced as it is now, and the computer screens at that time did not have the colors of LCD and other current colors, and many of them were even black and white. At that time, the method to distinguish whether it is a link is to underline it. On many black and white monitors, or web pages for color blind users, try to keep the underline as much as possible, otherwise the user will not be able to distinguish colors.
Of course, for the sake of beauty, modern web designs generally do not put underlines directly on the link. However, in order to take care of color blind users and black and white mobile phone monitor users, it is recommended to set the CSS style to underline when the user's mouse is triggered.
When you open the link to this page, you will find that some links will pop up to other windows when you open them, while some links will directly replace this page. This jump method can use the target property of the anchor link to set the jump window.
_self The current window is open , and the anchor link will be redirected to the current browser window by default, that is, the default target=_self<a href=https://www.VeVb.com/ target=_self>This is the current new window display Ewei Technology homepage</a>_blank New window opens
<a href=https://www.VeVb.com/ target=_blank>This is the new window to display the EV technology homepage</a>Unnamed target Opens in the same new window
<a href=https://www.VeVb.com/ target=_weigeti> If the _weigeti here is not the name or id inside the web page, all target=_weigeti links in the web page are opened in the same new window, and each link of _blank opens a different new window</a>Frame name or id
<a href=https://www.VeVb.com/ target=weigeti>Click here to display the E-wei Technology homepage in the frame below name=weigeti, and will not jump to a new window or replace the current window</a><iframe name=weigeti></iframe>_parent The parent window opens and loads the linked file into the parent frame set or parent window containing the link frame. If the framework containing the link is not nested, the linked file is loaded in the browser full screen window, just like the _self parameter.
<iframe> <a href=https://www.VeVb.com/ target=_parent>This is the inside of the frame</a></iframe>_top framework at the top level , for example, web page B is embedded in Web A, web page B is embedded in iframe web page C
<iframe> <iframe><a href=https://www.VeVb.com/ target=_top>This is the framework inside the frame</a></iframe></iframe>
If the connection in web page C is set to target=_parent, then remove web page B and directly embed the link page in web page C;
If target=_top in web page C, then all iframe frames will be directly jumped out and directly turned to the linked page in C.
_top opens the linked document in the current entire browser window, thus deleting all frames
External links have always been regarded as one of the core of search engine optimization. For this reason, all forms of external links have appeared, and not all external links have an effect on SEO.
Search engines are less willing to recognize Javascript, all of which is easy to understand.
<a href=# onclick=this.href='https://www.VeVb.com/'> Such a link is invalid for SEO</a><a href=# onclick=window.open('https://www.VeVb.com/');> Such a link is invalid for SEO and cannot be opened even under browsers such as Chrome</a>If you find that the other party's website has added the rel=nofollow attribute to your link when changing links with other people's websites through the source code, it means that this link is not crawled by search engines.
<a href=https://www.VeVb.com/ rel=nofollow> Such links are invalid for SEO</a><meta name=robots content=nofollow /><a href=https://www.VeVb.com/> If there is the above sentence at the beginning of the web page, then all links within the web page will not be crawled by the search engine, so they are invalid for SEO</a>
Google Search first launched a new algorithm to attack external links with the same color as those of Beijing, and this external link is generally considered a black link.
<style type=text/css>#vgtlink{background:#FFF}#vgtlink{background:#FFF}</style><div id=vgtlink> <a href=https://www.VeVb.com/ id=vgtlink> Such links are invalid for SEO</a></div> <a href=https://www.VeVb.com/ style=background:#FFF> Such links are also invalid for SEO</a>