Css: What Is Causing These Small Horizontal Spaces Between My Divs?
I have six divs ('group') all contained within a parent div ('groupwhite'), and everything is behaving normally with one exception: there is a small horizontal space between each o
Solution 1:
it's a natural space added by display: inline-block
you can either use float
or you can use a bit of a hack by adding font-size: 0
to .groupwhite
and then overriding the text size inside that container
Here is a link about fixes:
http://css-tricks.com/fighting-the-space-between-inline-block-elements/
Solution 2:
The line breaks between the divs are causing the spacing. HTML interprets all whitespace (newlines, tabs, real spaces) and runs of whitespace as if it were a single normal space.
To fix, just make sure that the div's end tag is flush with the next div's open tag. Like so:
</div><divclass="group"><!-- no line break, no whitespace, nothing at all -->
Post a Comment for "Css: What Is Causing These Small Horizontal Spaces Between My Divs?"