Sep 02 2010

How to Open Links in a New Browser Window

Posted by xpress in Uncategorized

Links are one of the most important parts of a website. They allow for your visitors to get from one location of your site to another with relative ease. So, what should be done if you want some of your links to open in a new browser window? Simply by adding a short piece of code within the HTML of the link, this problem can be easily solved.

The basic HTML structure of a link looks like this:

<a href=”http://another-site.com”>Example Link</a>

When clicked, the above link would open another-site.com in the same browser window that was currently being used. If we wanted that same link to open in a new browser window, we would need to add a short piece of code (target=”_blank”) to the above link.

The updated HTML for the link would now look like this:

<a href=”http://another-site.com” target=”_blank”>Example Link</a>

Now if a visitor were to click on the link, a new browser window would open and another-site.com would be displayed within the new window. If the visitor were to close the newly opened window, your site would still remain open on their screen.

If the link is to an external website, then it is especially important that the page opens in a new window so that the visitor does not click completely away from your website. This way the visitor remains on your site, and does not have to click the ‘back’ button to revisit your site.

 

If you would like to be kept up to date with web design news, trends and reviews then visit our web design blog.

Maui Houses For Sale Blog

Comments are closed.