I've noticed that <button> tags seem to be scaling em units from something other than the font-size. <div> tags aren't exhibiting this same behaviour.
This happens across the latest versions of chrome, firefox & ie.
They are both styled like this:
button, div {
width: 3rem;
height: 3em;
}
See this fiddle for an example.
If I size a div and a button both with a width of 3rem and height of 3em, I would expect them to be square, unless there is a font-size style affecting one of them, or an ancestor. The only font-size is on the <body> tag, but what happens is that the div is square, but the button has a smaller height than its width.
If I inspect the button in chrome, it says that it inherits the 1em font-size from the <body> tag, and yet the problem is fixed when I set its font size to 1em explictly (see fiddle).
Can anyone explain to me what's happening here? It feels like I'm missing something obvious.