HTML页面中的href属性用于指定页面的URL。如果href属性不存在,则<a>标记将不被视为超链接。
请记住,href属性应作为<a>标记的属性包括在内。应该在<body>…</ body>标记内使用。
您可以尝试使用以下代码使用href属性在HTML页面中建立页面链接:
<!DOCTYPE html> <html> <head> <title>HTML href attribute</title> </head> <body> <h1>Learn about the company</h1> <a href="/about/index.htm">About</a> <a href="/about/about_team.htm">Team</a> </body> </html>