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

How do I open a link on a new page in the browser?

I'm working on the How to Make a Website and I'm on the contact.html part. When I make the links for my twitter, it opens it on the current tab that I'm in, removing the current page altogether. I want the page to open on it's own on a separate tab in the browser. How do I do it?

1 Answer

Sean T. Unwin
Sean T. Unwin
28,690 Points
<a href="https://twitter.com" target="_blank">Twitter</a>

The key is the target="_blank" attribute and value.

Alternatively, you can always middle-click to open a new tab, but that's probably not what you were looking for. ;-p

I would recommend reading this article - CSS Tricks - When to Use target="_blank" for some pros and cons.

Thanks! it worked! you are the best!