Learn HTML
Lesson 1 - Overview Of The Web And HTML
Lesson 3 - Images And Multimedia
Lesson 4 - Writing Your First HTML Page
Lesson 5 - Overview Of CSS
Lesson 6 - CSS Selectors And Properties
Lesson 7 - Applying CSS To HTML
Lesson 8 - Box Model
Lesson 9 - Positioning And Layout
Lesson 10 - Flexbox
Links in HTML are essential for navigating between webpages. The <a>
tag is used to create a link. The href
attribute specifies the destination URL.
<a href="https://www.example.com">Visit Example.com</a>
In the example above, <a>
creates a link labeled "Visit Example.com". Clicking on it will navigate to the webpage specified by the href
attribute (https://www.example.com
).
To open a link in a new tab, use the target="_blank"
attribute:
<a href="https://www.example.com" target="_blank">Visit Example.com (opens in new tab)</a>
The target="_blank"
attribute instructs the browser to open the linked webpage in a new tab or window.
By default, clicking on the link without the target
attribute will navigate within the current tab or window.