Skip to content

Instantly share code, notes, and snippets.

@jmendiara
Created February 1, 2012 17:43
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 jmendiara/1718278 to your computer and use it in GitHub Desktop.
Save jmendiara/1718278 to your computer and use it in GitHub Desktop.
Annoying extra-pixel in Firefox
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
p {
line-height:32px;
font-size:28px;
font-family:Arial, Helvetica, sans-serif;
}
span.bold {
font-weight: bold;
}
</style>
<script>
function log(str) {
document.getElementById("log").innerHTML += str + "<br/>";
}
function assert(divID){
var realHeight = document.getElementById(divID).clientHeight;
if (realHeight == 32){
log("OK!! " + divID + " has the correct size");
}
else {
log("KO!!!!!! " + divID + " has size " + realHeight);
}
}
function check(){
assert("good");
assert("bad");
}
</script>
<body onload="check()">
<p id="good">
<span>Loren ipsum</span> Loren ipsum
</p>
<p id="bad">
<span class="bold">Bold</span> Loren ipsum
</p>
<p id="log">
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment