Friday, July 26, 2024

HTML Links


HTML links, created using the <a> tag, are used to navigate from one webpage to another. The href attribute specifies the URL of the destination page. Links can open in the same window, a new window, or in a specified frame. Text within the <a> tag is clickable, and it can also include images or other elements. Proper use of links enhances website navigation and user experience.

Examples:

<a href="https://www.example.com">Visit Example</a>

<a href="https://www.example.com" target="_blank">Open Example in a New Tab</a>

<a href="#section1">Jump to Section 1</a>


HTML Code:


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML Tutorial</title>
</head>
<body>
    <h1>HTML Links</h1>
    <p>HTML links are defined with the <code>&lt;a&gt;</code> tag.</p>
    <pre>
        &lt;a href="https://www.example.com"&gt;This is a link&lt;/a&gt;
    </pre>
</body>
</html>

The Output of the above code:


HTML Tutorial - Page 7

HTML Links

HTML links are defined with the <a> tag.

        <a href="https://www.example.com">This is a link</a>