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

Nathaniel Nasarow
Nathaniel Nasarow
10,291 Points

Opening links in a new window

Once again, questions!

When setting social media links and other weblinks in a page, how can I make it so that when the user clicks the link, it opens the new link in a new window, rather than taking the user away from your page?

3 Answers

junaid shafiq
junaid shafiq
1,361 Points

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_target

If you set the target attribute to "_blank", the link will open in a new browser window

Niyamat Almass
Niyamat Almass
8,176 Points

hey just add the blank target.It looks like :-

blank.html
<a href="this.is.mylink.com" target="_blank">This is my cool link</a>

I think that will solve your problem.

Also you can use <base target="_blank"> in head section of your website. http://www.w3schools.com/tags/tag_base.asp