PGTUTOR.COM
You are here: HOME >> HTML tutor >> Lesson 10

HTML tutor- Lesson 10

It's about time we learn how to create links.

Links are created using the anchor tag: <a>. href is the main attribute related to the anchor tag just like src is the main attribute related to the image tag. Here's an example:

<body>
<a href="http://www.google.com/">Go To Google</a>
</body>

View your webpage here

The value for the href attribute is the location where you want to go.


What if you want to open the link in a new window? Then you use the target attribute with the _blank value.

<body>
<a href="http://www.google.com/" target="_blank">Go To Google</a>
</body>

View your webpage here

We're not done with the target attribute yet. In the next lesson we'll explore the anchor tag along with its target attribute in more detail.


PgTutor - The easy way to make a website ...
Lessons: Intro 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25



PGTUTOR is an award winning website. In the past 2 years, we've won over 20 legitimate awards. Go to our awards page to verify for yourself.




You're not taking a risk when buying our products. If for any reason you're unsatisfied with the quality of our product(s), we'll refund your money. Also, you get to keep the product you bought.