: HTML encoding in the alt attribute Why is it that » valid for an alt atribute but » is not?
Why is it that » valid for an alt atribute but » is not?
More posts by @Eichhorn148
1 Comments
Sorted by latest first Latest Oldest Best
It depends on your doctype. In HTML 4 and 5, using named entities like » is perfectly valid. However, in XHTML you must use numbered entities like » - most named entities are invalid, except for ", ', <, > and &.
Note: the alt tag is irrelevant in this case, it allows the same textual content as outside of HTML tags.
Simplest solution in my opinion: switch to the HTML5 doctype - <!DOCTYPE html>. It forces standards modes in all browsers, is future proof and is dead simple to remember.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.