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
Evan Hoyt
8,703 Pointsthe email icon/link will not do anything
My email link that is supposed to bring up a compose email box will not do anything.
Here is that area of code:
<li class="social_media1">
<a id="gmail1" href="mailto:evanhoyt2000@gmail.com"><img src="images/mail.png" alt="Gmail logo"></a>
</li>
3 Answers
Colin Marshall
32,861 PointsIs it because the ID on your anchor tag is spelled incorrectly? You have "gmaill"
Colin Marshall
32,861 PointsUnfortunately I don't have an explanation as to why this will fix the problem, but if you set the target attribute on the anchor link it seems to work. It doesn't seem to matter what the target is set to, as long it is set. For example:
<a href="mailto:me@me.com" target="_parent">Email Me</a>
Evan Hoyt
8,703 PointsI am still having trouble. Do you think it makes a difference that I am using an image as a link instead of an actual link? (Sorry, that was bad wording.) I wouldn't think it would, because the twitter and facebook links are images and have no trouble. When i put in an 'http://' before the 'mailto:evanhoyt2000@gmail.com', it brings me to the Gmail home page, but nothing else; however, that is not how Nick put it in the video.
Evan Hoyt
8,703 PointsJust kidding about the image question. I just tried it without a link, but it didn't do anything in the same way.
Colin Marshall
32,861 PointsHave you tried in different browsers? Does your browser have Adblock Plus turned on? If you do have ABP, try turning it off.
Colin Marshall
32,861 PointsI added target="_parent" to your CodePen and it worked for me. So it should not have anything to do with the link being an image. It is probably browser-related, or something is awry with the default email client you have set for your OS.
Evan Hoyt
8,703 Pointswhen I did it in codePen, it sort of worked, meaning it actually opened up a page, but it was blank and nothing happened. I tried it in IE, (which took forever) but it said my default mail client was not properly installed. In Google Chrome, where would I look to see if APB was turned on or off. I don't think it is on because we still get ads in YouTube Videos and pop-ups in different websites.
Evan Hoyt
8,703 PointsI know for Mozilla it is under Extentions, but in Chrome, I don't see it in extensions.
Colin Marshall
32,861 PointsYou'll need to lookup how to set the default email client for your operating system. Once that is set I think you will be ok.
You probably do not have ABP installed. You would have had to have added it to your Chrome extensions. Also, having it installed does not mean you don't see YouTube ads and it is not a pop-up blocker.
Evan Hoyt
8,703 PointsI looked it up and it says Windows 7 (what I have) does not have a default mail client. I will try it on my XP...:( takes forever Thank you so much for your time and help, I will tell you if it works.
Evan Hoyt
8,703 PointsIt is still not working. If I tell it to open in a new tap, the URL is 'mailto:evanhoyt2000@gmail.com'. Shouldn't it be a http://?
Colin Marshall
32,861 PointsDid you set a default email client on the XP machine? Also, you could just download and install Thunderbird on your Windows 7 machine and set it to be the default email client.
Evan Hoyt
8,703 PointsI installed some Microsoft mail client and it worked! Thank you so much for your time and frustration.
Colin Marshall
32,861 PointsGreat! Glad we sorted that out!
Evan Hoyt
8,703 PointsEvan Hoyt
8,703 PointsThat actually says gmail(one), but that was observant. Would you like me to put up more code?
Colin Marshall
32,861 PointsColin Marshall
32,861 PointsMy bad!
Yes, more code will be necessary. Maybe put it on codepen since it sounds like it might be done with javascript.
Evan Hoyt
8,703 PointsEvan Hoyt
8,703 Pointshttp://codepen.io/anon/pen/EaJzbG
Ignore the view of the website, it looks much better really, but I haven't made it responsive just yet. I also haven't refined the class names to better match their objects and I haven't made the CSS DRYer. I do not know enough JavaScript to put it in my website, but if you could give me some hints, that would be great.