Let's say I have the following HTML / CSS to have two DIV columns, each with a width of 50 pixels.
<div style="width:100px;margin:0px;"> <div style="width:50px; display:inline-block;">A</div> <div style="width:50px; display:inline-block;">B</div> </div>
In this code snippet, if I have no spaces between the two inner divs (for example, where <!-- HERE --> ):
<div style="..."> <div style="..."></div><div style="..."></div> </div>
HTML is then presented in two columns, as expected. However, if I have spaces between them, they are not displayed side by side, because the white space occupies a nonzero width.
The obvious solution for this is to not have spaces between the internal DIVs, however I use HTML auto-formatting to format the HTML code and automatically insert spaces between the two internal DIVs.
Is there any solution for this, so that the two internal DIVs are displayed as expected, even when there are spaces between them?
source share