Is
allowed to make space in terms of semantic, web standards and accessibility and cross browser compatibility?
The reason it was invented was to prevent line breaks (in fact it's an acronym "non-breaking space"), however it's obsolete: You should use the "white-space:nowrap;" CSS attribute.
Whatever you do, NEVER use it to indent or as a "separator" between, for example, table cells.
<p>Hello to you</p>
Is equivalent to the preferred form
<p style="white-space: nowrap">Hello to you</p>
Since you tagged your question with “XHTML”, the answer is “it depends”.
If you serve your XHMTL documents as XML then Firefox will not read entities from the DTD file. As a consequence, it won’t recognized named entities such as
. However, this is a rare case because XHTML documents are normally served as HTML to accommodate non-supporting browsers (= MSIE).
That said, “make spaces” is a rather nebulous term. You should use CSS to position your elements and put indentations in the text (other than source code inside a <pre>
tag). Do not use spaces for formatting purposes, ever (the same is true in text processing applications). This isn’t acceptable semantically and it will screw with your layout as soon as the users have some custom settings enabled in their browsers. Non-breaking spaces are only to be used, as the name indicates, to prevent a break between things that belong on one line, e.g. a product name and the product version number: e.g. “Ubuntu 10 9.10
”, or inside a telephone number or in formulae.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With