Alternative to the HTML Bold tag

后端 未结 21 1864
野性不改
野性不改 2020-12-23 15:35

Okay, so I know that in HTML you can use the tag, but isn\'t there a \"weight=bold\" attribute that I can use in the

21条回答
  •  猫巷女王i
    2020-12-23 16:30

    is a last resort

    You can use , but only as a last resort. There are a variety of elements that work as good alternatives to , here they are in order of most usefulness:

    More useful alternatives

    • For important text:
    • For stress emphasized text:
    • For headings, not just page headings but paragraph headings and others of all kinds:

      through

    The practical edge case for use of

    The only case where I would advocate using is if

    1. you have styled in a different way that you don't want displaying for the text that you have in mind,

    2. you don't want italic emphasis or a heading, and

    3. you are about to use an inline span or a span with a class just for bolding text. (For example: )

    Then it's reasonable to use instead, because in that case it'll probably be cleaner/shorter and more semantic than an unsemantic span, and terceness/readability is a good reason for making that choice, since b has been redefined for use as an element denoting printed emphasis.

提交回复
热议问题