What is the difference between HTML tags
and ?

后端 未结 13 1044
时光取名叫无心
时光取名叫无心 2020-11-22 05:48

I would like to ask for some simple examples showing the uses of

and . I\'ve seen them both used to mark a section of a pa
13条回答
  •  既然无缘
    2020-11-22 06:04

    Just for the sake of completeness, I invite you to think about it like this:

    • There are lots of block elements (linebreaks before and after) defined in HTML, and lots of inline tags (no linebreaks).
    • But in modern HTML all elements are supposed to have meanings: a

      is a paragraph, an

    • is a list item, etc., and we're supposed to use the right tag for the right purpose -- not like in the old days when we indented using
      whether the content was a quote or not.
    • So, what do you do when there is no meaning to the thing you're trying to do? There's no meaning to a 400px-wide column, is there? You just want your column of text to be 400px wide because that suits your design.
    • For this reason, they added two more elements to HTML: the generic, or meaningless elements
      and , because otherwise, people would go back to abusing the elements which do have meanings.

提交回复
热议问题