How to Make Links Open in a New Window
This How-to applies to: 2.1
When you're linking to a page on a separate website, it's nice to have it open in a new window so you don't lose people to that site. Learn how to control that with a touch of HTML.
- Create an external link to an outside website
- Dive straight into the HTML of the page -- Click the icon that looks like a scroll or simply says HTML in little letters. You'll know you clicked the right spot when your nicely formatted page turns into a mess of garbled HTML.
-
Find the link that you created. If the link I created was for
the phrase "newspaper" linking to the NY Times (like this: newspaper), I would look for HTML like the
following:
<a href="http://www.nytimes.com">newspaper</a>
-
Add the following little scrap of code that appears in dark grey to that
HTML:
<a target="_blank" href="http://nytimes.com">newspaper</a>
- Sometimes you'll see a target attribute already there like this:
<a target="_self" href="http://www.nytimes.com>newspaper</a>
- In that case, just change _self to _blank
- That's it! Hit Save. When anyone clicks your modified link, it will open in a new window.
by
samk
—
last modified
2007-10-10 09:11
Contributors:
Sam Knox
All content on this site is licensed under a Creative Commons License.