HTML5 – Links
Links, also known as hyperlinks, are used to navigate between web pages or to different locations within the same page. In HTML5, links are created using the <a>
element.
Here is an example of how to create a link in HTML5:
<a href="http://www.example.com">Visit Example.com</a>
The href
attribute specifies the destination of the link. It can be a web page URL, an email address, or a location on the same page (using a fragment identifier).
Here is an example of a link to an email address:
<a href="mailto:info@example.com">Send an email</a>
Here is an example of a link to a location on the same page:
<a href="#footer">Jump to the footer</a>
You can style links using CSS, such as by changing the color, underline, or hover effect. You can also apply CSS classes or IDs to links to give them specific styles.