When using a
, I've noticed if the button is left with no text, an unexpected white space appears below it.
The fiddle here shows it: https://jsfiddle.net/042pt648/
If you comment out the empty button and try the others, they work fine without a white space below. Upon investigation, it seems the height of the parent div with class
is different when the button is empty. When the white space is visible, the parent div has a height of
while the button has a height of
, causing the space. In the other cases, the height is the same as the button(
) just as expected.
Could someone explain what is causing this?
Here is the snippet in question:
border: 1px solid blue;