Adding Some Interactivity and Contacts
Adding Some Interactivity and Contacts
Welcome back! You've gained a solid understanding of adding a header, footer, and main sections to structure your webpage. Now, let's elevate your webpage further by adding a touch of interactivity and a contact section. This lesson will build on what you've already learned and introduce you to additional HTML attributes that make your website more functional and engaging.
What You'll Learn
In this lesson, you will learn how to:
- Add a Contact Section: A contact section typically includes ways to reach the webpage owner, such as email.
- Use the
mailtoAttribute: This attribute allows users to open their default email client directly from your webpage.
Here's an example snippet to get started:
Let's break down the example to understand the new elements:
- Contact Section: The
<section>element with theidattribute set to"Contact"creates a new section for the contact information. - The
<a>element with thehrefattribute set to"mailto:email@example.com"creates a link that opens the user's default email client with the email address. - We also added an internal link in the footer to help you navigate back to the top of the page. The
<a>element with thehrefattribute set to"#Home"links to theidattribute of the Home section.
