Search code examples
htmlasciihtml-entities

How to Code Double Quotes via HTML Codes


In HTML, What is the preferred way to specify html codes like ", and what is the major differences? For example:

&quot;    <!-- friendly code -->
&#34;     <!-- numerical code -->
&#x22;    <!-- hex code -->

Which one should I use and would it ever be an issue if one of these gets deprecated?


Solution

  • There really aren't any differences.

    &quot; is processed as &#34; which is the decimal equivalent of &x22; which is the ISO 8859-1 equivalent of ".

    The only reason you may be against using &quot; is because it was mistakenly omitted from the HTML 3.2 specification.

    Otherwise it all boils down to personal preference.