html tutorial - How to remove the space between inline-block elements in CSS - html5 - html code - html form
Answer: Remove space between the elements
The CSS display property with the value inline-block
is extremely helpful for controlling the dimensions also as margin and padding of the inline components. However, whereas using the inline-block
visual format the whitespace within the markup language code creates some visual space on the screen. But you can get rid of it using the following simple techniques.
Solution 1: Remove Space Between Elements
Example
Solution 2: Set Zero Font Size on Parent Element
Example
You can also utilize the negative margin of 4 pixels like margin: -4px;
on the inline-block elements to fix this problem, however the above two methods are more straightforward.