Search code examples
htmlsemantic-markup

Trailing space inside style tag


This one has trailing space inside the tag

The quick brown <strong>fox jumps </strong>over the lazy dog

where, this has not.

The quick brown <strong>fox jumps</strong> over the lazy dog

The thing is, <strong/> tag works ok, the space doesn't get bolded, but the problem comes with underlines.

The quick brown <u>fox jumps </u>over the lazy dog

results in a underline applied to space, which doesn't seem very "correct" to me.

But the reason why I'm asking this, is because, by default, when you select (double-click) a word within text, the trailing space is always taken into selection (at least on Windows). And that results in a wrongly applied underline.

So, which is more correct?

Thanks in advance!


Solution

  • Windows' selection algorithm is horribly broken - i'm coming up against this problem all the time with users of our CMS. Do you want that space underlined? Probably not. Therefore, the former is 'correct'.