What's the difference between and , and ?

前端 未结 22 1996
清酒与你
清酒与你 2020-11-22 08:10

What\'s the difference between and , and in HTML/XHTML? When should you use

22条回答
  •  醉梦人生
    2020-11-22 09:06

    , , and tags are traditionally representational. But they have been given new semantic meaning in HTML5.

    and was used for font style in HTML4. was used for italic and for bold. In HTML5 tag has new semantic meaning of 'alternate voice or mood' and tag has the meaning of stylistically offset.

    Example uses of tag are - taxonomic designation, technical term, idiomatic phrase from another language, transliteration, a thought, ship names in western texts. Such as -

    I hope this works, he thought.

    Example uses of tag are keywords in a document extract, product names in a review, actionable words in an interactive text driven software, article lead.

    The following example paragraph is stylistically offset from the paragraphs that follow it.

    The event takes place this upcoming Saturday, and over 3,000 people have already registered.

    and had the meaning of emphasis and strong emphasis in HTML4. But in HTML5 means stressed emphasis and means strong importance.

    In the following example there should be a linguistic change while reading the word before ...

    Make sure to sign up before the day of the event, September 16, 2016

    In the same example we can use the tag as follows ..

    Make sure to sign up before the day of the event, September 16, 2016

    to give importance on the event date.

    MDN Ref:

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong

提交回复
热议问题