Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Fractions

  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Fractions

    Is there any way to get fractions (other than 1/4, 1/2. and 3/4) to display properly? It looks bad to have some going sideways and some up and down... Thank you!
    Murphie

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    <mfrac>
    <mn> 1 </mn>
    <mn> 2 </mn>
    </mfrac>

    That's presentation MathML, something which only Mozilla and Amaya support natively.

    The best you can do with HTML is:

    <sup>1</sup>/<sub>2</sub>

  • #3
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, that's better than nothing--is there anyway to make it smaller? I tried <small> but it's still bigger than I would like. I'm sorry, I'm just a beginner! Thank you!
    Murphie

  • #4
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    You could try wrapping it in a <p> tag and using css...

    example;
    Code:
    <style>
    .fraction {
    font-size:8pt;
    }
    </style>
    <p class="fraction"><sup>1/2</sup></p>
    Omnis mico antequam dominus Spookster!

  • #5
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you! Will try, out of time now...

  • #6
    New Coder
    Join Date
    Dec 2002
    Location
    SW England
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Character Entity Approach

    Hi,

    Another possible approach which could be used with the more common fractions would be to use a character entity - e.g.

    &quot;&amp;frac12;&quot; for a half,
    &quot;&amp;frac14;&quot; for a quarter,
    etcetera.

    Cheers,
    Stuart.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •