+ 3

Display fractions in HTML

Is it possible to display fractions in HTML with a line in the middle, the numerator above and the denominator below the line? Like this: https://www.freemathhelp.com/images/lessons/numerator_denominator.png

13th Oct 2017, 12:03 AM
Simon
Simon - avatar
5 Respuestas
+ 3
Perhaps this is what you want... https://code.sololearn.com/WnNrpVz5L0ZP/?ref=app
13th Oct 2017, 12:38 AM
Calviղ
Calviղ - avatar
+ 2
Thank you!
13th Oct 2017, 12:41 PM
Simon
Simon - avatar
13th Oct 2017, 12:14 AM
Calviղ
Calviղ - avatar
+ 1
Try this : <span style="display: inline-block;vertical-align: middle;"> <div style="text-align: center;border-bottom: 1px solid black;">35</div> <div style="text-align: center;">41</div> </span>.
24th Dec 2017, 9:12 AM
Sumit Kumar
Sumit Kumar - avatar
0
Writing fraction in html is quite tricky. My site https://www.fractioncalc.com always display fractions in html format. The trick is to use table to display fraction. I will share here my html code. Here is my code to display 1/2 in html format. <table><tbody><tr><td style="border-top:0px;border-left:0px;border-right:0px;border-bottom:1px solid #333;padding:0px;font-size:0.7em;text-align:center;vertical-align: bottom;padding:0px;">1</td></tr><tr><td style="font-size:0.7em;text-align:center;border:0px;vertical-align:top;padding:0px;">2</td></tr></tbody></table>
13th Feb 2020, 11:40 AM
Jerryl Torremocha
Jerryl Torremocha - avatar