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!

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 Iconography

Sebastian Eguez
Sebastian Eguez
8,248 Points

Opening a link on a new tab

I tried using this: target="_blank"

<footer> 
            <a target="_blank" href="http://twitter.com/shots_insight"><img src="img/twitter-wrap.png" alt "Twitter Logo" class="social-icon">
            </a> 
            <a  target="_blank" href="http://facebook.com/animalpy91"><img src="img/facebook-wrap.png" alt "Facebook Logo" class="social-icon">
            </a> 
            <p>Ā© 2016 Sebastian Eguez</p> 
    </footer> 

I want my social links to open on a new tab. How can I do this? : )

http://w.trhou.se/rjnmvv05o0

2 Answers

Muhamed Asil
Muhamed Asil
7,453 Points

you should add equal sign after alt.

<footer> 
            <a target="_blank" href="http://twitter.com/shots_insight"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon">
            </a> 
            <a  target="_blank" href="http://facebook.com/animalpy91"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon">
            </a> 
            <p>Ā© 2016 Sebastian Eguez</p> 
    </footer> 
Steven Parker
Steven Parker
227,167 Points

:point_up: One part of opening a window on a new tab is to have your link include the target attribute, set to "_blank". It looks like you already have that part.

:v: The other part is a browser setting. The user chooses if they want the default operation to be a tab or a window. You can't control that part.

And while it's not related to your question, Muhamed has a good point: your images are missing the equal sign after the alt property.