Attribute quotes are optional in HTML5.
What are the pros and cons of quoting them?
id=example href=http://example.com class="example example-1" href="http://example.com/p=47"
Update: Added benefits based on answers:
Benefits of quoting all attributes:
- all editors can handle it right
- more consistent
- improved portability (easier to change doctype)
- easier to maintain (especially if attributes can become empty)
- easier to โfind and replaceโ changes
- clean doc (if you think quotes improve readability)
Advantages of excluding additional quotes:
- file size slightly reduced
- clean doc (if you prefer minimal text)
performance html standards html5
ryanve Jun 27 '11 at 15:35 2011-06-27 15:35
source share