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!

Did you find this article helpful?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

The Community Support team wrote the article you're looking at now. We like to think it's perfect, but we're sure you have some suggestions. Please, let us know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Google Adwords Credit Link Doesn't Work in AMP
  2. my email is being rejected
  3. Can I run the FiverrScript on my hosting

Support Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.