The following example shows a <button> element whose height is not the height of the button. What is the best way to remove this excess height while remaining semantic as well as keep the <button> inline?
If I set the display:block button, then the excess height will be removed. If I set the parent font size to 0, it will also be deleted. If I changed the <button> element to a <div> , it will also be fixed. Should I just not be semantic?
I tested this under a stable version of Google Chrome.
.box { height: 30px; width: 30px; background-color: green; } .outer { background-color: blue; } button { border: 0; margin: 0; padding: 0; }
<div class='outer'> <button class='box'></button> </div>
source share