p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning HTML, XHTML, CSS, and JavaScript (http://p2p.wrox.com/forumdisplay.php?f=541)
-   -   Problem with character entities (http://p2p.wrox.com/showthread.php?t=78852)

mister_tea April 5th, 2010 05:24 AM

Problem with character entities
Hi guys,

I am an absolute noob with html programming and I would appreciate it if someone could tell me: why doesn't the character entity for one-third,

, work for me?

This link seems to indicate that Firefox 3 and IE 8 (which is what I'm using) should be compatible with this code.



PeterPeiGuo April 5th, 2010 11:10 AM

For one third, you have to specify its unicode. ⅓ is not defined in HTML 4 specification, but ¼ is. However HTML 5 will have ⅓ defined.

<p>This is one third: ⅓</p>
<p>This is one quarter: ¼</p>
<p>This does not work: &frac13;</p>

Unicode in decimal for one third is: 8531.

mister_tea April 6th, 2010 09:11 AM

Thanks for that Peter - makes sense now.

All times are GMT -4. The time now is 02:47 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.