I have two elements containing divs with the inline-block property.
The code of the divs inside this container is not indented:
<div class="container-no-indentation">
<div>
<div>1</div><div>2</div><div>3</div><div>4</div><div>5</div><div>6</div><div>7</div>
</div>
</div>
And the code of the divs inside this second container is indented:
<div class="container-indentation">
<div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
</div>
</div>
jsfiddle:
If you run the jsfiddle you will se that the divs inside ".container-no-indentation" are rendered more close each other than the divs within ".container-indentation".
Why is that happening and how can I prevent this behaviour?
Since the divs within ".container-no-indentation" are dynamically generated, they will always be unindented, and I want them to be displayed like the divs inside ".container-indentation".
Thanks in advance!
EDIT:
This is how I generate the divs:
var noIndent = document.querySelector(".container-no-indentation");
for (var i=0; i<7;i++) {
var div = document.createElement("div");
div.innerHTML = i+"";
noIndent.appendChild(div);
}