What is the difference between HTML tags
and ?

后端 未结 13 1318
时光取名叫无心
时光取名叫无心 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:22

    As mentioned in other answers, by default div will be rendered as a block element, while span will be rendered inline within its context. But neither has any semantic value; they exist to allow you to apply styling and an identity to any given bit of content. Using styles, you can make a div act like a span and vice-versa.

    One of the useful styles for div is inline-block

    Examples:

    1. http://dustwell.com/div-span-inline-block.html

    2. CSS display: inline vs inline-block

    I have used inline-block to a great success, in game web projects.

提交回复
热议问题