HTML code for an apostrophe

前端 未结 17 986
独厮守ぢ
独厮守ぢ 2020-11-30 18:01

Seemingly simple, but I cannot find anything relevant on the web.

What is the correct HTML code for an apostrophe? Is it ?

相关标签:
17条回答
  • 2020-11-30 18:19

    Just a one more link with nicely maintained collection Html Entities

    0 讨论(0)
  • 2020-11-30 18:19

    As far as I know it is ' but it seems yours works as well

    See http://w3schools.com/tags/ref_ascii.asp

    0 讨论(0)
  • 2020-11-30 18:22

    A standard-compliant, easy-to-remember set of html quotes, starting with the right single-quote which is normally used as an apostrophe:

    • right single-quote — ’ — ’
    • left single-quote — ‘ — ‘
    • right double-quote — ” — ”
    • left double-quote — “ — “
    0 讨论(0)
  • 2020-11-30 18:23

    Firstly, it would appear that ' should be avoided - The curse of '

    Secondly, if there is ever any chance that you're going to generate markup to be returned via AJAX calls, you should avoid the entity names (As not all of the HTML entities are valid in XML) and use the &#XXXX; syntax instead.

    Failure to do so may result in the markup being considered as invalid XML.

    The entity that is most likely to be affected by this is  , which should be replaced by  

    0 讨论(0)
  • 2020-11-30 18:25

    Note that ' IS defined in HTML5, so for modern websites, I would advise using ' as it is much more readable than '

    Check: http://www.w3.org/TR/html5/syntax.html#named-character-references

    0 讨论(0)
  • 2020-11-30 18:25

    Even though ' reads nicer than ' and it's a shame not to use it, as a fail-safe, use '.

    ' is a valid HTML 5 entity, however it is not a valid HTML 4 entity.

    Unless <!DOCTYPE html> is at the top of your HTML document, use &#39;

    0 讨论(0)
提交回复
热议问题