Issue
I have an IMG tag in my HTML5 document that reads:
<img src="elements/background.png" alt="" width="100%" height="100%" />
When I run the document through the W3C validator (doctype is HTML5, encoding is UTF-8), it comes up with two error messages, one for the width attribute and one for the height attribute. Both say something to the effect of, "Expected a digit but saw % instead."
I checked on the W3C website, and the width and height attributes for the IMG tag both still support percentages in HTML5. What's going on?
Solution
According to W3C:
[...] The attributes, if specified, must have values that are valid non-negative integers.
Change the values to integers or use CSS.
Answered By - vinga Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.