标签: html seo standards semantic-markup
将链接和图像放在h1中是否可以?
SEO明智,这是有道理的,但我正在辩论它在语义上是否正确以及是否符合标准。
实施例
<h1> <a href="example.com" title="link to example.com"> <img src="img.png" alt="example logo" /> Example.com </a> </h1>
答案 0 :(得分:13)
是
允许h1标记包含"phrasing content"。这意味着"phrasing elements intermixed with normal character data"。 a和img代码are both phrasing elements。
h1
a
img