How to show Unicode characters in IE using HTML

别等时光非礼了梦想. 提交于 2019-12-08 15:48:39

问题


I'm trying to show the copyright and infinity signs at the bottom of my page using this code:

&#x00A9 Copyright Mikle 2009 - &#x221E

This works perfectly in Firefox 2, 3 and Chrome. IE7 though, is showing me the actual codes (like you see above) instead of what I expect and the other browser show:

© Copyright Mikle 2009 - ∞

This is probably some stupid thing, but this is making me understand why IE is getting so much hate. How do I fix this?


回答1:


Entities need a semi-colon:

©

Firefox is being incorrectly over-helpful in this case.




回答2:


  1. Use decimal values.
  2. Always terminate entity with ; (semicolon) even in context, where it's optional.
  3. Use named entity whenever possible. Your example entities should be written © © and ∞

Other approach, is to forget about entities, and just put plain UTF-8 character there.




回答3:


Can't you use "©" ?

This page has a list of HTML codes for common symbols.



来源:https://stackoverflow.com/questions/669265/how-to-show-unicode-characters-in-ie-using-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!