Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
216,083 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.