Is it fine to use span elements in div elements?

前端 未结 2 362
臣服心动
臣服心动 2020-12-22 13:36

I am making a website with personal articles. The body of my articles is a basic div containing paragraphs, but recently I found it useful to use some spa

2条回答
  •  萌比男神i
    2020-12-22 13:55

    There is nothing wrong with using a span element inside of a div element. It is absolutely valid. It will have no negative impact on search engine optimization.

    div elements are block elements and span elements are inline elements. Inline elements can be placed inside of block elements. The opposite is what you want to avoid: Do not put div elements inside span elements.

提交回复
热议问题