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

HTML How to Make a Website Adding Pages to a Website Add a New Page

Nate Pezzillo
Nate Pezzillo
2,325 Points

paragraph text and image are linked to contact page

The link I created for facebook works fine, but the image and paragraph text on my about page is linked to my contact page. I'm not sure why this is happening.

Kevin Beall
Kevin Beall
13,828 Points

From what you have said it sounds like your <a> tag is around both the <img> and the <p> tags. This should only be around the <img> if this is the only area you require to link to Facebook.

like this... <a><img></a> <p></p>

3 Answers

Justin Warren
Justin Warren
7,805 Points

Feel free to post a code snippet too! Thanks

Nate Pezzillo
Nate Pezzillo
2,325 Points

thank you for the response @kevin beall @Justin warren, I believe I have the correct syntax but I'm still not sure what is happening here. I would like only the word "facebook" to be a link. Here is my code

<section> <img src= "img/CabinJazzJammin.jpg" alt= "Photo of Cabin Jazz" class= "profile-photo"> <h3>ABOUT</h3> <p>Welcome to my website.</p> <p>feel free to follow me on<a href="https://www.facebook.com">facebook<a/> </p> </section

Kevin Beall
Kevin Beall
13,828 Points

I added this code to my website and it works as desired. Maybe there is some css padding which is making the click box much bigger than needed. Hope this helps.

Ps. Also noticed that your closing anchor tag is <a/> and not </a> tried this also in my code but did not make any difference how the code worked.

Justin Warren
Justin Warren
7,805 Points

Appears to work in my browser too. The word facebook is a link. May be worth re-submitting this question to the community with the CSS and a longer explanation! Hope this helps!