html The a tag defines a hyperlink, which is used to link from one page to another. The most important attribute of the element is the href attribute, which indicates the target of the link.
#html How to use a tag?
Function: tag defines a hyperlink, used to link from one page to another.
Description:
The most important attribute of the element is the href attribute, which indicates the target of the link. The default appearance of links in all browsers is that unvisited links are underlined and blue, and visited links are underlined and purple. Active links are underlined and red
Note:
If you do not use the href attribute, you cannot use the following attributes: download, hreflang, media, rel, target and type attributes. The linked page usually displays in the current browser window, unless you specify another target (target attribute). Please use CSS to style the link.
html a tag example 1
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <a href="http://www.php.cn">php中文网</a> </body> </html>
The effect is like:
# #html a tag example 2
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <a href=" target="_blank" >百度</a> </body> </html>
The above is the detailed content of How to use html a tag. For more information, please follow other related articles on the PHP Chinese website!