![]() |
HTML Links are very necessary for all web pages. All web sites have links. HTML Links are hyperlinks. |
HTML Links:
HTML Links are very necessary for all web pages. All web sites have links. HTML Links are hyperlinks.
Links help users jump from their current web page location to another.
To make HTML Links we just need to use the <a> element with the href attribute that specifies a URL to a page.
HTML Link Structure:
👉Start tag. <a>
👉href Attribute, e.g. href="index.html"
👉Element Content. A text e.g. Home Page. It can also be an image and other HTML Elements.
👉 End tag. </a>
Internal Linking Example:
Linking inside our directory.
<a href="file in-the-same-folder.html">example</a>
👉A Note! Some external links may not open from the Try It Yourself Editor but you can save the file to your local storage and test it in a real browser.
External Linking Exampele:
Linking outside our directory.
<a href="https://www.wikipedia.org">
Wikipedia</a>
Opening Link in New Tab Example:
We can easily open a link in a new tab.
To do it we need to use the target attribute with the value _blank .
This would be helpful if you do not want your visitors to leave your web site.
<a href="https://www.wikipedia.org" target="_blank"> Wikipedia </a>
crossorigin="anonymous">
0 Comments
That's all there was to HTML tutorials Did we miss something? Les us know in the comments section below. We'll be adding more tutorials on html introduction pretty soon, so stay tooned! :)