24/7 U.S. Support – 877-595-4482
If you have a link on your website that goes to a different website, then you will want the page to open in a new window. By having the page open in a new window, your visitor will not leave your website and can easily go back to it once they are done at the site that you linked to. This is a great way to keep visitors on your website when you want to have a link to a different site.
For reference, this is the same HTML code we used in a previous section to make a hyperlink:
<a href="/support/nextpage.html">Click here to go to my next page</a>
The basic form is the same, but we need to change a few things. First, we will change the link that the text is pointed to. When a link is pointed to your own site you only need the name of the file on your server, but if you are pointing the link to a different website then the full link is needed with the http://. For example:
<a href="http://www.differentwebsite.com">Click here to go to my next page</a>
If you used the link as we have above, it would go to the new website, but it would stay in the same window and take your visitor away from your site. To change this, we can change the "target" of the link. The target attribute allows you to tell the page where to open the new link. To open the page in a new window, we will use the target attribute _blank. As it sounds, this tells the link to open in a blank page, instead of of the same page. It will look like this:
<a href="http://www.differentwebsite.com" target="_blank">Click here to go to my next page</a>
Now we will just change the text of the link:
<a href="http://www.differentwebsite.com" target="_blank">Click here to visit a different site with more information!</a>
And you have created a link that will open in a new window!
| 1. | Creating a Basic Link to a New Page |
| 2. | Creating an Email Link |
| 3. | Creating a Link that Opens in a New Window |
| 4. | Creating an Anchor Link |
| Email: | support@WebHostingHub.com | Ticket: | Submit a Support Ticket |
|---|---|---|---|
| Call: |
877-595-4HUB (4482) 757-416-6627 (Intl.) |
Chat: | Click To Chat Now |
Copyright © 2013 Web Hosting Hub - Privacy Policy - Terms of Service