Why is the deprecated?

后端 未结 7 867
生来不讨喜
生来不讨喜 2021-02-04 23:34

I understand that this tag could easily be replaced with and a little bit of CSS, but in real life markup I often find that <

7条回答
  •  囚心锁ツ
    2021-02-05 00:17

    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 ( ).

提交回复
热议问题