Home >Web Front-end >HTML Tutorial >Hyperlink tags of commonly used HTML tags_html/css_WEB-ITnose
Having learned about format tags and text tags before, this chapter starts with learning about hyperlink tags
3. Hyperlink tags
1. Category: Hyperlink tags are divided into relative URLs and absolute URLs
2. Function:
Relative URL: Points to a file within the site (for example: jump to xxx.html)
Absolute URL: Point to another site (for example: jump to http://www.baidu.com)
3. Attribute function:
4. Code example:
<!DOCTYPE html><html> <head> <!-- 超连接标签分为相对URL和绝对URL --> <title>超连接标签</title> <meta charset="utf-8"> <meta name="keywords" content="keyword1,keyword2,keyword3"> <meta name="description" content="this is my page"> <meta name="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> </head> <body> <a href="Main.html">返回主页</a><br> <a href="TagFormat.html" target="_blank">格式标签</a><br><span style="white-space: pre;"> </span> <!-- 相对URL --> <a href="http://www.hao123.com">hao123</a><br><span style="white-space: pre;"> </span> <span style="font-family: Arial, Helvetica, sans-serif;"><!-- 绝对URL --></span><span style="white-space: pre;"> </span> </body></html>
5. Running results:
Click the format tag and open the html of the format tag
When you click on the hao123 tag, you will enter this URL