So, there seems to be some whitespace added to an element on my page when I set the display to be inline-block
. Is there a way to get rid of this white space without changing the line-height to 0px
or changing the display type to block
and manually setting a width? I may want the red element below to expand dynamically based upon the content in the future.
This is what I want (no green below the red):
This is what I am getting (green below the red):
Here's a JSFiddle of the issue: https://jsfiddle.net/rstL6omk/5/