Can we place `` >`

后端 未结 5 1080
时光说笑
时光说笑 2020-12-05 04:04

Can we place inside

according to web standards? like this

Demo text

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 04:27

    To summarize the other answers, it is W3C valid to use an inside an

    .

    Though to be completly valid you should add an alt attribute to your image, because it's mandatory. This attribute doesn't need to contain text. It's better letting it empty than repeating what is already written in the h1 tag.

    In your case if the image is purely decorative it should be:

    Demo text

    More info on text alternatives for decorative images: https://www.w3.org/WAI/tutorials/images/decorative/

    If the image has a particular meaning or contains a text different than the one in the h1, then use an appropriate alternative.

提交回复
热议问题