HTML Links
Links
HTML Links are very necessary for all web pages. All websites 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 eg
href="index.html"
- element content. A text eg Home Page. It can also be an image and other HTML elements
- end tag
<a>
Internal Linking
Example:
<a href="file-in-the-same-folder.html">Example</a>
External Linking
Example:
<a href="https://movies.dataidea.org/">Movies</a>
Opening Link in New Tab
Example:
We can easily open a link in a new tab.
To do this, we need to use the target
attribute with the value _blank
.
This would be helpful if you do not want to your visitors to leave your website.
<a href="https://football.dataidea.org/" target="_blank">Movies</a>
To be among the first to hear about future updates of the course materials, simply enter your email below, follow us on (formally Twitter), or subscribe to our YouTube channel.