Click here to get back home

Fractions Simply Won't Display Properly

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Fractions Simply Won't Display Properly selowitch 06-29-2005
Get Chitika Premium
Posted by selowitch on June 29, 2005, 10:06 am
Please log in for more thread options


I've been searching in vain for a way to present typographically
correct fractions (not resorting to <sup> and <sub> tags) but have been
frustrated by the fact that the glyphs for one-half, one-eighth,
three-quarters, etc. do not display in the correct typeface (or even
consistently the same typeface) and seem totally resistant to attempt
to fix this through CSS:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Language" content="en">
<table>
<tr valign="top"><td>&#x00bc;</td></tr>
<tr valign="top"><td>&#x00bd;</td></tr>
<tr valign="top"><td>&#x00be;</td></tr>
<tr valign="top"><td>&#8531;</td></tr>
<tr valign="top"><td>&#8532;</td></tr>
<tr valign="top"><td>&#8533;</td></tr>
<tr valign="top"><td>&#8534;</td></tr>
<tr valign="top"><td>&#8535;</td></tr>
<tr valign="top"><td>&#8536;</td></tr>
<tr valign="top"><td>&#8537;</td></tr>
<tr valign="top"><td>&#8538;</td></tr>
<tr valign="top"><td>&#8539;</td></tr>
<tr valign="top"><td>&#8540;</td></tr>
<tr valign="top"><td>&#8541;</td></tr>
</table>
</body>
</html>

Any thoughts of a solution (other than using inlines like 1/2, 3/4,
etc. or other hacks)?


Posted by David Ross on June 29, 2005, 11:41 am
Please log in for more thread options


selowitch@gwi.net wrote:
>
> I've been searching in vain for a way to present typographically
> correct fractions (not resorting to <sup> and <sub> tags) but have been
> frustrated by the fact that the glyphs for one-half, one-eighth,
> three-quarters, etc. do not display in the correct typeface (or even
> consistently the same typeface) and seem totally resistant to attempt
> to fix this through CSS:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html lang="en">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> <meta http-equiv="Content-Style-Type" content="text/css">
> <meta http-equiv="Content-Language" content="en">
> <table>
> <tr valign="top"><td>&#x00bc;</td></tr>
> <tr valign="top"><td>&#x00bd;</td></tr>
> <tr valign="top"><td>&#x00be;</td></tr>
> <tr valign="top"><td>&#8531;</td></tr>
> <tr valign="top"><td>&#8532;</td></tr>
> <tr valign="top"><td>&#8533;</td></tr>
> <tr valign="top"><td>&#8534;</td></tr>
> <tr valign="top"><td>&#8535;</td></tr>
> <tr valign="top"><td>&#8536;</td></tr>
> <tr valign="top"><td>&#8537;</td></tr>
> <tr valign="top"><td>&#8538;</td></tr>
> <tr valign="top"><td>&#8539;</td></tr>
> <tr valign="top"><td>&#8540;</td></tr>
> <tr valign="top"><td>&#8541;</td></tr>
> </table>
> </body>
> </html>
>
> Any thoughts of a solution (other than using inlines like 1/2, 3/4,
> etc. or other hacks)?

First of all, I hope you have a </head> and <body> between the last
<meta> and the <table>.

For fractions that have entity references in the HTML 4.01
specification, use them in place of the numeric character
references:
        &frac14; for 1/4
        &frac12; for 1/2
        &frac34; for 3/4
If the glyphs exist in the viewer's display font, this will work.

For other fractions (and for the above three, if you choose),
create a style that displays the inlines with a smaller font
relative to the current font-size and slightly elevated. For
example:
        .fract { font-size: 80%; vertical-align: 20% }
Then use
        <p>1 = <span class=fract>1/3</span> + <span class=fract>2/3</span>
This will work even if the viewer does not have fractional glyphs.

Actually, I would probably use <font> in place of <span> because
the effect is supposed to change the size font. I know <font> is
deprecated, but its use here would be mnemonic when I manually edit
an HTML file.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.

Posted by Sam Elowitch on June 29, 2005, 3:18 pm
Please log in for more thread options


Sorry for the essentially duplicate posts. I was foolishly using Google
Groups and got frustrated when my replies weren't showing up. Apologies.



Posted by Harlan Messinger on June 29, 2005, 4:14 pm
Please log in for more thread options


David Ross wrote:
> selowitch@gwi.net wrote:
>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>>"http://www.w3.org/TR/html4/loose.dtd">
>><html lang="en">
>><head>
>><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
>><meta http-equiv="Content-Style-Type" content="text/css">
>><meta http-equiv="Content-Language" content="en">
>><table>
>><tr valign="top"><td>&#x00bc;</td></tr>
>><tr valign="top"><td>&#x00bd;</td></tr>
[snip]
>><tr valign="top"><td>&#8541;</td></tr>
>></table>
>></body>
>></html>
>>
>
> First of all, I hope you have a </head> and <body> between the last
> <meta> and the <table>.

Technically not necessary--and neither are the <head> or </body>.
However, it's still weird to include one and not the other.

Posted by Harlan Messinger on June 29, 2005, 1:16 pm
Please log in for more thread options


selowitch@gwi.net wrote:
> I've been searching in vain for a way to present typographically
> correct fractions (not resorting to <sup> and <sub> tags) but have been
> frustrated by the fact that the glyphs for one-half, one-eighth,
> three-quarters, etc. do not display in the correct typeface (or even
> consistently the same typeface) and seem totally resistant to attempt
> to fix this through CSS:

CSS won't add glyphs to a font that doesn't have them.

Similar ThreadsPosted
Simply log-in panel July 12, 2006, 5:16 am
simply the dumbest question today I bet...on click open in a speicifc frame October 18, 2004, 1:00 pm
Surprise - IE 6 not behaving properly September 26, 2007, 12:22 pm
Getting google to cache my site properly. April 6, 2005, 10:24 am
On-Page Anchors not working properly December 7, 2005, 10:33 pm
tag not working properly on linux January 10, 2006, 12:48 am
pages not displaying properly in safari March 18, 2006, 5:18 pm
Problem with Anchor link now working properly in IE! February 1, 2005, 12:33 pm
Safari unable to properly render a preLoadPage August 31, 2007, 11:57 pm
how to properly hide/show table cells? January 31, 2008, 5:38 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap