I have a fraction and I want to display it neatly and nicely.
For example
4/5
would be
4
-
5
I have looked at this and
I, personally, see no need for JavaScript in this case.
Check out the following:
span.frac {
display: inline-block;
text-align: center;
vertical-align: middle;
}
span.frac > sup, span.frac > sub {
display: block;
font: inherit;
padding: 0 0.3em;
}
span.frac > sup {border-bottom: 0.08em solid;}
span.frac > span {display: none;}
7 42⁄73.
CodePen