00 Votes

HTML Validator: Attribute alt not allowed

Question by Guest | Last update on 2023-12-03 | Created on 2018-02-26

When I try to validate my website with an HTML Validator, I get the following error:

Attribute alt not allowed on element a at this point

In principle, I have only provided a link with a title, which is displayed on a mouseover:

<a href="http://www.example.com" alt="Text">Link Text</a>

What can I do to prevent this error? I have always done that this way.

ReplyPositiveNegative
0Best Answer0 Votes

Just take the title attribute instead of the alt attribute.

So, for your example:

<a href="http://www.example.com" title="Text">Link Text</a>

In the browser, the title attribute is also displayed on a mouseover and the validator will no longer complain.
Last update on 2023-12-03 | Created on 2018-02-26

ReplyPositive Negative
Reply

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.