P粉3492227722023-08-23 11:30:02
<div>...</div><div>...</div> ^ |--- 这里没有空格或换行符。
Your spaces are line breaks that the browser converts into "spaces" when displayed.
Or you could try using CSS to make some small adjustments:
A flexbox will conveniently ignore spaces between its child elements and will be displayed like a continuous inline-block element.
http://jsfiddle.net/AWMMT/470/
body { display: flex; flex-wrap: wrap; align-items: end; }
P粉7318612412023-08-23 00:09:15
Spaces in HTML. There are several possible solutions. From best to worst:
float: left
instead of display: inline-block
, but this will have a bad effect on the height: http://jsfiddle.net/AWMMT/3 /font-size
of the container to 0 and the appropriate font-size
for the inner elements: http://jsfiddle.net/AWMMT/4 / - This is very simple, but you can't take advantage of relative font size rules (percentage, em) on inner elements