Can we add a inside H1 tag?

前端 未结 8 1936
感情败类
感情败类 2021-02-01 11:41

Is it a proper method to use span tag inside H1 tag?

8条回答
  •  春和景丽
    2021-02-01 12:19

    Yes, it's typically fine to use a span inside of an h1. span is an inline element, so it's typically okay to use it inside anything (that allows elements inside it!)

    And there's not really a cleaner way to do it sometimes, say if you want to style only part of the h1.

    On the other hand... don't do it if it's not necessary, as it is a little ugly : )

提交回复
热议问题