Skip to content

Instantly share code, notes, and snippets.

@rs77
Created April 22, 2012 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rs77/2466938 to your computer and use it in GitHub Desktop.
Save rs77/2466938 to your computer and use it in GitHub Desktop.
Fractions using Divs
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>HTML Fractions - Divs</title>
<style>
div.qtn {
font-size: 14px;
}
div.q {
float: left;
height: 2em;
padding: 0.75em 0 0.75em 0;
}
div.frac {
float: left;
text-align: center;
}
div.numer {
border-bottom: 1px solid black;
}
div.denom {
border-top: 1px solid black;
}
</style>
</head>
<body>
<div class="qtn">
<div class="q">Substitute 4 for 'x' in the equation: &nbsp;</div>
<div class="frac">
<div class="numer">x<sup>2</sup> + 3x + 5</div>
<div class="denom">2x</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment