Links and Navigation
Connect pages together using the anchor <a> tag and redirect users to other websites or sections.
Learning Goals
The Core Concept
Links are what makes the web a 'web'. In HTML, we create links using the anchor tag `<a>` with the `href` attribute. The `href` attribute tells the browser where to go when someone clicks the link. You can link to external websites using their full URL, or to other pages on your own website using relative paths. To open a link in a new tab, we add `target="_blank"`.
Visual guide
Html concept flow
A simple original diagram to connect the lesson idea with real project flow.
Code & Implementation
<!-- External Link opening in a new tab -->
<a href="https://techidea.online" target="_blank" rel="noopener">Visit TechIdea</a>
<!-- Internal Link to another page on your site -->
<a href="/about">Read About Us</a>Expected Output
Visit TechIdea (opens in new tab) Read About Us (opens in same tab)
Build a Navigation Bar Link
Hands-on practice task
The Challenge
Write HTML containing two links: one to https://techidea.online that opens in a new tab, and a second linking to a local file contact.html in the same tab.
Helpful Hints
- •Use the href attribute for the paths.
- •Use target="_blank" and rel="noopener" for the external link.
Quick Knowledge Check
What does target="_blank" do?
Can I turn an image into a link?
Continue Learning
Next steps after this lesson
Write HTML containing two links: one to https://techidea.online that opens in a new tab, and a second linking to a local file contact.html in the same tab.
Ready to put your coding skills to the test?
Don't just read—write code! Use our free Try-Code Playground to experiment with real-time preview, or search utilities on our Developer Tools List.