鉴于下面的代码(两个50%宽度div,在100%宽度容器内),为什么div“bar”的结束标记之后的空格会影响渲染(至少在Chrome和FireFox中)?
<style>
* {
border:0;
margin:0;
padding:0;
box-shadow:0 0 1px 0px silver;
}
.foo {
width: 100%;
}
.bar {
width: 50%;
display: inline-block;
text-align: center;
}
</style>
<div class="foo">
<div class="bar">
...a new customer
<!-- the whitespace between the following divs affects rendering - why? -->
</div> <div class="bar">
...an existing customer
</div>
</div>