<div class="eq-c">
Fraction =
<div class="fraction">
<span class="fup">50</span>
<span class="bar">/</span>
<span class="fdn">10</span>
</div>
= 5
</div>
// Body
body{
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
font-size: 2rem;
}
// Fraction
.fraction {
display: inline-block;
vertical-align: middle;
margin: 0 0.2em 0.4ex;
text-align: center;
& > span{
display: block;
padding-top: 0.15em;
}
& span{
&.fdn{
border-top: thin solid black;
}
&.bar{
display: none;
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.