Ammar
Ammar

Reputation: 19

Why doesnt my <a href= link work?

I'm using a random text editor and saving pages to .html and the "link for gizmodo isn't clickable

    <!doctype html>

<html>
<head>
<title>This is the title</title>
</head>

<body
<a href="http://www.gizmodo.com">This is the link for gizmodo</a>
</body>

</html>

<!--"a" stands for anchor-->

Upvotes: 0

Views: 17306

Answers (2)

user2330624
user2330624

Reputation: 300

The body attribute is <body> </body> not <body </body>. You are missing a closing > on the opening tag.

This is the renovated code:

<!doctype html>

<html>
<head>
<title>This is the title</title>
</head>

<body> <!-- THIS IS WHERE YOU FORGOT THE ">" -->
<a href="http://www.gizmodo.com">This is the link for gizmodo</a>
</body>

</html>

<!--"a" stands for anchor-->

Upvotes: 1

John Conde
John Conde

Reputation: 219934

You're missing the closing bracket of your <body> tag. This will cause the HTML for the <a> tag to be malformed and not work as expected.:

<body  <-- HERE
<a href="http://www.gizmodo.com">This is the link for gizmodo</a>
</body>

Upvotes: 2

Related Questions