开发者

Is it ok to put a link <a> and an image <img> inside an h1 <h1>?

开发者 https://www.devze.com 2023-03-07 17:00 出处:网络
Is it ok to put a link and an image inside an h开发者_运维知识库1? SEO wise, it makes sense but I\'m debating whether its correct semantically and in regard of standards compliance.

Is it ok to put a link and an image inside an h开发者_运维知识库1?

SEO wise, it makes sense but I'm debating whether its correct semantically and in regard of standards compliance.

Example

<h1>
  <a href="example.com" title="link to example.com">
    <img src="img.png" alt="example logo" />
    Example.com
  </a>
</h1>


Yes.

An h1 tag is allowed to contain "phrasing content". This means "phrasing elements intermixed with normal character data". a and img tags are both phrasing elements.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号