Differences between and

前端 未结 4 1350
忘掉有多难
忘掉有多难 2021-01-18 05:18

There are several articles about this topic but I\'m not able to understand the relevant difference between and

. The s
4条回答
  •  借酒劲吻你
    2021-01-18 05:29

    Just see their definitions:

    • q element:

      […] some phrasing content quoted from another source

    • blockquote element:

      […] a section that is quoted from another source

    The last part is the same ("quoted from another source"), so they only differ in "phrasing content" vs. "section".

    q can only contain phrasing content (and it can only be used where such phrasing content is expected). blockquote can only contain flow content (and it can only be used where such flow content is expected). In that sense, they are similar to span (~ q) and div (~ blockquote).

    Some other differences:

    Note that blockquote is a sectioning root, which means that any headings or sectioning elements it may contain will not be part of the document’s outline. q can’t contain headings or sectioning elements in the first place.

    Note that you MUST NOT use any quotation marks when using q (not before, not inside, not after), because user agents should add them automatically. There is no such restriction for blockquote (however, it’s probably unlikely that you’d need some for block quotes).

提交回复
热议问题