I have multiple spans with padding and borders one right after another that I want to wrap as the window dictates. But when they wrap, they overlap. Any way to keep them from overlapping without using a table? (Note: they only overlap vertically. horizontally they are fine)
Share
Use
display:block<span>isdisplay:inlineby default, so the borders and padding you added aren’t actually affecting it’s size. You’re seeing the overlap because the width of the border/padding is larger than theline-heightYou may need
float:leftas well, or you can trydisplay:inline-blockinstead.More info on
display: http://www.quirksmode.org/css/display.html