
How to create a link in html
April 20, 2009 at 5:03 PM
by GeorgeTo create a link within your website
This is the code you need if you are trying to link to a page that is on your site.
<a href="page2.html">This is a link</a>
Example: This is a link to "newfangled_employee_blogs"
Linking to an external site.
To make a link that that redirects to an external site, the href must begin with http://
<a href="http://cnn.com" >Link to CNN</a>
Example: This is a link to an external site
Link that opens up in either a new window or new tab.
This is the code you need to make a link open up in a new window or a new tab depending on what browser you are using.
<a href="page2.html" target="_blank">This is a link that opens up in either a new window or new tab</a>
Example: This is a link that opens up in a new window / tab
How to make a link that opens up in a new window (popup).
To make a link open up in a new window (popup), here is the code.
<a target="_blank" onclick="window.open ('page2.html','_blank', 'status=1, toolbar=0, location=0, menubar=0, resizable=1, left=20, top=50, width=90, height=90');
return false;" href="#">Test Popup 3</a>
Example:
This is a popup link
Here is some of the optional stuff that one can specify for the new window by either specifying 0 or 1.
Please note: In programming, "0" means false, "1" means true.
If you are specifying more than one item, you must separate each item by a comma (as shown in the example above).
Thanks for that, George! We were just talking about links that open up new windows-- and now I don't have to look up the code!