More quotes than I need...
I think it's legal to skip quotes in a lot of places where it's common to use them. For example,
seems to be the norm, but could also be written:
Correct, yes? In many cases, the extra quotes here and there aren't worth arguing about, but in a case where you have html being generated by a script, say php cranking through a database displaying a table, you may have a ton of quotes used in this manner that could be skipped.
Is there any downside to not including these quotes?
Only that it requires you to remember the rule governing when they can be omitted.
Originally Posted by tracknut
In certain cases, authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Thanks Charles. I think I got it. The previous sentence to the one you quoted is:
So as long as the attribute does not contain quotes itself, or anything outside of the list you quoted above, I could skip quoting the attribute value.
By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). Single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa. Authors may also use numeric character references to represent double quotes ("
and single quotes ('
. For double quotes authors can also use the character entity reference ".
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)