Monday, 18 November 2024

How to Use the address Element to model contact details?

The <address> element in HTML is used to provide contact information for the author or owner of a document or an article. It typically contains information like the name, email address, physical address, and phone number. The <address> element is often rendered in italics by default in most browsers to distinguish it from the rest of the text.

The element gives semantic meaning to the contact information, which can be useful for accessibility and SEO (Search Engine Optimization) purposes. It's commonly used in footers or at the bottom of articles, where contact information is typically provided.

 

address-tag.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Address Element Example</title>
</head>
<body>

    <h1>Contact Us</h1>
    <p>If you have any questions, feel free to reach out to us:</p>

    <address>
        Written by Harikrishna Gurram.<br>
        Visit us at:<br>
        https://self-learning-java-tutorial.blogspot.com<br>
        Bangalore<br>
        Email: <a href="mailto:learning-java@example.com">learning-java@example.com</a><br>
        Phone: (123) 456-7890
    </address>

</body>
</html>

 


<address> element can be effectively used with other HTML elements like <footer>, <article>, and <section>.

 

The <address> element is a semantic HTML element that clearly indicates that the enclosed information is contact-related. It's useful for making web documents more accessible and providing clear, structured information about the content's authors or the organization behind a website.

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment