+ 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
5 ответов
+ 3
Perhaps this is what you want...
https://code.sololearn.com/WnNrpVz5L0ZP/?ref=app
+ 2
Thank you!
+ 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>.
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>