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 trialNathaniel Nasarow
10,291 PointsOpening 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
1,361 Pointshttp://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
8,176 Pointshey just add the blank target.It looks like :-
<a href="this.is.mylink.com" target="_blank">This is my cool link</a>
I think that will solve your problem.
Aleksey Fishouk
8,788 PointsAlso you can use <base target="_blank"> in head section of your website. http://www.w3schools.com/tags/tag_base.asp