Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Adding Pages to a Website Build the Contact Page

Email link

How do I make the email link on my Contact page go to a page where I can be emailed? It doesn't bring up any errors in w3c, but it doesn't do anything when I click it. I tried my email login url, but it didn't work. What url would I use? Here is my code below. I'm working on the "Building an html website" track Thanks.

<li class="mail"><a href="mailto:mauroj5@msn.com">mauroj5@msn.com</a></li>

5 Answers

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Jeff,

The way you have it set now will open the email client of the person that clicks the link. If you want to take them to a page on your website that you build with a email form included in the page you need to link it like this.

<li class="mail"><a href="http://www.MyWebsite.com/MyContactPage">Email Me</a></li>

MyContactPage is whatever you name the page with your email form in.

Hope this helps.

"The way you have it set now will open the email client of the person that clicks the link."

So the way it's coded now, it will go to the person's email client? That's fine with me. Does the link work for everyone but me, the creator of the link?

Wayne Priestley
Wayne Priestley
19,579 Points

Jeff,

Yep, the way its coded now it will open the email client. It should be exactly the same for you too. Are you trying it on a live website? I'm not sure how it works in workspaces.

I tried opening my email link on the contact page, but it didn't work. Can you try opening it? The website address and code are below. Thanks again!

www.treehousewebsitejeff.com

<ul class="contact-info">
          <li class="phone"><a href="tel:503-995-3524">503-995-3524</a></li>
          <li class="mail"><a href="mailto:mauroj5@msn.com">mauroj5@msn.com</a></li>
          <li class="twitter"><a href="https://twitter.com/mauroj11">@mauroj11</a></li>
        </ul>

That's strange. It opens for everyone but me.

Thanks for your help. Happy Holidays!

It will open only from the default browser. I did the below testing - Step 1 - Made Firefox as default browser and then opened my website on it. Then clicking the email link opened my default mailbox to send email. I tried same on Chrome (not default browser)but it didn't work.

Step 2 - Made Chrome as default browser and repeated the steps from above and this time email linked worked on Chrome and not Firefox.

Give it a try on the default browser and let me know.