Is Value For Alt Atrribute Not Required In Html5 To Pass Validation?
Solution 1:
The parsing rules for attributes start here. Note that the default action on encountering the first character of an attribute is this:
Start a new attribute in the current tag token. Set that attribute's name to the current input character, and its value to the empty string. Switch to the attribute name state.
So in HTML5, alt
and alt=""
are equivalent.
It is acceptable to have an empty string value for an alt
attribute when the image is entirely presentational (though really in that case, that image should be included with CSS rather than in the content), or when it would repeat information already available to the detriment of screen reader users. The point of putting an empty string there instead of leaving off altogether is that many screenreaders, if there isn't an alt
attribute, will read out the full path in the src
attribute instead.
Solution 2:
HTML 5 now definesfoo
as being the same as foo=''
Post a Comment for "Is Value For Alt Atrribute Not Required In Html5 To Pass Validation?"