css - Weird spacing with buttons -
having slight css issue buttons in codepen.
the first 1 seems spacing buttons, , i'm not sure why. if click on + button add more tables, weird spacing gone, , follows input type button margin style.
how can fix this?
because whitespace matters, basically, deal inline elements. <input>s in source code separated whitespace; ones injected (by js) aren't.
there various solutions this, of them listed in this question (i'd suggest checking them instead of accepted one). those, in turn, can grouped into...
1) 'tag clash', removing whitespace in between elements. can done this...
<input type="button" class="some_class" /><input type="button" class="some_class" /><input type="button" class="some_class" /> ... or this...
<input type="button" class="some_class" /><!-- --><input type="button" class="some_class" /><!-- --><input type="button" class="some_class" /> 2) 'style collapse' - leaving whitespace in place, making invisible. in absense of simple solution, involves creating container around inline elements, , setting font-size , line-height 0.
the downside of approach you'll have restore these properties elements inside container.
3) 'floating' - turning inline elements blocks, applying 'float' style them. way whitespace go away visually too.
Comments
Post a Comment