Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

Open link in new tab – HTML

Length: 10 minutes|

Demo

Summary

<a target="_blank" href="https://example.com/">Link text</a>

Details

To force the browser to open a link in a new tab, add the target attribute with the value _blank.

<a target="_blank" href="https://example.com/">Link text</a>

Note: It’s possible the link might open in a new window instead of a new tab based on the user’s browser settings.

Exercises

Try recreating the HTML code from the Demo section. Then try customizing the text inside the link.

Reference

The Anchor element on MDN

Back to: HTML Reference > HTML Links