Question

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?

Was it helpful?

Solution

Entities need a semi-colon:

©

Firefox is being incorrectly over-helpful in this case.

OTHER TIPS

  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.

Can't you use "©" ?

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top