This CSS reference page displays example code that shows how to style tags to create fractions and square roots for displaying mathematics.
<!DOCTYPE html>
<html>
<head>
<title>XoaX.net's CSS</title>
<style>
span.cFrac {
display: inline-block;
font-size: 50%;
text-align: center;
vertical-align: sub;
}
span.cFrac > sup {
display: block;
border-bottom: 1px solid;
font: inherit;
}
span.cFrac > sub {
display: block;
font: inherit;
}
span.cSqrt {
border-top: 1px solid;
}
</style>
</head>
<body>
<h1 style="font-weight: normal;"><i>y</i> = <span class="cFrac"><sup>1</sup><sub><i>x</i></sub></span></h3>
<h1 style="font-weight: normal;"><i>z</i> = <span class="cFrac"><sup>1</sup><sub><i>x</i> + <i>y</i></sub></span></h3>
<h1 style="font-weight: normal;"><i>x</i> =
<span class="cFrac"><sup>-<i>b</i> ± √<span class="cSqrt"><i>b</i>² - 4<i>ac</i></span>
</sup><sub>2<i>a</i></sub></span></h1>
<h1 style="font-weight: normal;"><i>y</i> = √<span class="cSqrt"> <i>x</i>³ + 1</span></h3>
</body>
</html>
© 20072025 XoaX.net LLC. All rights reserved.