I understand the need for &
, <
, etc. But is "
necessary? I suppose it could be useful inside tag attributes, but inside the text, outside any tag, is it necessary?
views:
81answers:
3Certainly not necessary, your HTML will validate just fine without it.
However, if your HTML is generated and includes user input in unknown text encodings, or if you’re supplying HTML to people who might not serve it with the correct text encoding, then you might want to err on the safe side and encode any slightly odd-looking character as an entity.
No, it is not necessary when used in normal html content.
for escaping quotes in tag attributes you can use "
or either \"
or \'
depending on which you want to escape.
No, it's not. As an example, the specifications for HTML 4.01 (http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#h-5.3.2) state:
[...] authors may use SGML character references.
That 'may' implies you are not forced to use them.