将链接和图像放在h1内可以吗?

SEO明智,这是有道理的,但我正在就其语义是否正确以及是否符合标准进行辩论。

例子

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

最佳答案

是的。
h1标记允许包含"phrasing content"。这意味着"phrasing elements intermixed with normal character data"aimg标签are both phrasing elements

关于html - 将链接<a>和图像<img>放在h1 <h1>内是否可以?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6081180/

10-15 18:39