Validating HTML5 Image Tags

Am I not allowed to specify a unit of width and height on <img> tags in HTML5?

I get this error from the validator:

Poor value of 122px for attribute width on img element: Expected digit, but saw p instead.

+7
source share
3 answers

Drop the "px" part. Use only non-negative integers .

+19
source

Move the percentage width from the html tag to a line in a line:

For example:

Change this line

 <iframe width="100%" height="588" style="border:none; background:transparent; overflow:hidden;" /> 

:

 <iframe height="588" style="border:none; background:transparent; overflow:hidden; width:100%;" /> 

then he will check ...

+5
source

just write 122 instead of 122p

+3
source

All Articles