vbezhenar vbezhenar - 1 month ago 16
HTML Question

Why <nobr> tag is deprecated?

I understand that this tag could easily be replaced with

<span class="nowrap">
and a little bit of CSS, but in real life markup I often find that
tag is more appropriate. It's not about style, it's about content.
<nobr>V. V. Putin</nobr>
for example (in russian typography last name and first name shouldn't be line breaked, I think similar rules apply to other languages).

I guess that deprecation means there's something better but I don't see how styling is better than separate tag. Of course there are places where CSS should be used. Do I miss something?


It isn't deprecated because it was never standard in the first place.

HTML is (in theory) a semantic markup language. It describes the structure and semantics of a document along with relationships to other resources.

HTML is not supposed to describe presentation. A bunch of presentational features were added during the browser wars. Some of these became standardised. Most of them were subsequently deprecated when CSS came along.

CSS is a language for describing presentation. When you have a chunk of text that shouldn't have a line break in it, that is usually a matter of presentation so CSS is the right place to do it.

The exceptions are usually handled by non-breaking spaces (&nbsp;).