I am working on a web site, and am wondering if you need to put quotation marks around HTML attributes for example I've seen code like:<img src=http://example.com/image.jpg width=350px height=200px />
instead of:<img src="http://example.com/image.jpg" width="350px" height="200px" />
.
Does anyone know the answer to this?
If the attribute contains a string that is not ascii or has whitespace then you need to wrap it in quotes
Attributes are placed inside the start tag, and consist of a name and a value, separated by an "=" character. The attribute value can remain unquoted if it doesn't contain ASCII whitespace or any of " ' ` = < or >. Otherwise, it has to be quoted using either single or double quotes. The value, along with the "=" character, can be omitted altogether if the value is the empty string.
link here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With