Recently I was editing someone else's code and I noticed that spaces were used something like the following:
<div>Some text Some other text</div>
I naturally assumed that the browser would combine the extra spaces, so this is really just four spaces. Testing this out though - it is actually 7 spaces (in chrome at least)! This is because the browser renders both the in between spaces and the nbsp;
spaces as well.
So my question is, when will the browser render white space and when won't it? In other words, when will a single space character be rendered vs ignored?
JSFiddle Demo: http://jsfiddle.net/L7x7t/3/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…