JasonN
JasonN

Reputation: 25

I got this error on w3 schools validator

Is anyone familiar with the following W3 School Validation error? It is a simple IMG element and it is giving a very funny error on line 43. Column 112. I am stumped.


Error Line 43, Column 112: Attribute target not allowed on element img at this point.

…/images/logo.png" target="_blank" alt="AltText" title="SomeTitle" />

Attributes for element img:

Global attributes

alt

src

crossorigin

usemap

ismap

width

height


A Quick Note: "Column 112" is the closing bracket of the <img/> syntax.

Does anyone know what on earth this means? I cannot for the life of me figure this out and it is the only thing stopping my HTML5 code from validating. Just one little error according to W3 and I cannot understand this and any help would be greatly appreciated.

Upvotes: 0

Views: 2621

Answers (2)

Melvin Guerrero
Melvin Guerrero

Reputation: 361

Delete you target="_blank" from you img tag, because, it should be added on your a tag. eg:

<a href="#" target"_blank"><img src="#" /></a>

Upvotes: 0

Quentin
Quentin

Reputation: 943563

You have a target attribute on an img element. That isn't allowed and doesn't make sense.

Delete target="_blank"


While you are at it, you should get rid of the title attribute (as it doesn't convey any useful information) and write better alt text.

Upvotes: 2

Related Questions