I noticed that my spans have strange spacing. It's not a major problem, just curious as to why.
<div id="timerDiv">
<h2>Stopwatch</h2>
<h2>
<span class="stopwatchSpan" id="timerDisplayHr">00</span>
<span>:</span>
<span class="stopwatchSpan" id="timerDisplayMin">00</span>
<span>:</span>
<span class="stopwatchSpan" id="timerDisplaySec">00</span>
<span>:</span>
<span class="stopwatchSpan" id="timerDisplayMsec">00</span>
</h2>
<button id="timerBtnStart">Start</button>
<button id="timerBtnStop">Stop</button>
<button id="timerBtnReset">Reset</button>
</div>
The spans show no border, no padding, but when inspecting the element there is a space, not acknowledged by the inspector, between spans. (Pic 1)
To fix it, I used a trick I learned (from good 'ol Stackoverflow) to make tables butt up together: I put all of the html code/tags next to each other on one line with no spacing. (Pic 2)
So, my question is: why does white space matter in this situation, where normally the browser ignores code white space.
Or does it? Is it normally so minor that we don't notice it until we get a situation like this?
Also, with the problem "fixed" via the "all on one line" method, the ":" spans are still slightly offset as they are not in the centre of their designated space, but are, for lack of a better term, aligned left inside their character or span space. (Pic 2)