Is The Same As When It Comes To Accessibility?
Solution 1:
You should use the alt=""
attribute. Each example of the null alt attribute in the specs for providing alternative text for an image explicitly uses it. Here's another resource on the empty alt=""
attribute
However.. if I were to look at the DOM inspector in Chrome and look at an img
that had alt=""
in the source code, I would see <img src="[srcpath]" alt>
.
The Failure Criterion F65 in the WCAG 2.0 standards note that the presence of the alt
attribute is sought. It does not clarify whether or not the alt attribute must be explicitly declared as empty (alt=""
) for HTML5 standards, and as long as you're using the HTML according to the spec, having <img src="[srcpath]" alt>
would technically be considered accessible.
So in summary - yes, they technically are the same when it comes to accessibility, but I'm not one to derive from given instruction. By using alt=""
, you are being aware of the purpose of the alt
attribute, and keeping consistency in your alt techniques with respect to the HTML specifications.
Solution 2:
Both have the empty string as value, so they are equivalent.
HTML5 defines that attributes can be specified in four different ways, among them the "Empty attribute syntax":
Just the attribute name. The value is implicitly the empty string.
Post a Comment for "Is The Same As When It Comes To Accessibility?"