HTML Validation "img attribute width/height has invalid value"
Question by Guest | 2014-06-03 at 23:55
For the following HTML code:
<img src="img.jpg" alt="img" width="100px" height="100px">
I get these two errors in my HTML Validator:
Warning: <img> attribute "width" has invalid value "100px" Warning: <img> attribute "height" has invalid value "100px"
Can someone explain to me why this causes an error and how to get rid of this error message?
Related Topics
How to resize Image before Upload in Browser
Tutorial | 13 Comments
Send HTML5 Canvas as Image to Server
Tutorial | 0 Comments
HTML5: Upload Images with Client Side Resize
Tutorial | 9 Comments
jQuery: Send HTML5 Canvas to Server via Ajax
Tutorial | 0 Comments
HTML: Preassign HTML Form with Data
Tutorial | 0 Comments
jQuery: Read and Change Data Attribute Value
Tutorial | 0 Comments
CSS: Include CSS Stylesheets in HTML
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
The declaration of "px" is not necessary with the attributes "width" and "height", because the values stated here are "px" by default. So, just write "100" instead of "100px":
This should fix the HTML Validator "errors".
2014-06-04 at 01:29