在链接中包装块级元素的 SEO 效果

SEO effects of wrapping block-level elements in links

有时当我在网站上工作时,网页设计有类似方框的东西(尤其是网格中的网店产品),我往往会犹豫是否将整个方框设为 link。例如:

<a class="product-box" href="/product/123">  
    <img src="/someimage.jpg">
    <h3>My product</h3>  
    <span class="price">1000$</span>  
    <button>See detail</button>  
</a>

当这些类似盒子的元素是完整的 link 时,对我来说似乎更加用户友好,因为在移动设备上,更难点击一个小按钮。但是,我不相信这样做后是否对 SEO 没有负面影响。当一大块 HTML 包含在 <a> 标签中时,我觉得很奇怪。

很难找到关于此事的任何讨论,因此欢迎提出任何意见。

这是关于这个主题的valid in HTML5, so you're ok to wrap block-level elements in a link. Here's another article

也就是说,Google 对这种做法仍持观望态度。根据来自 Webmaster Central Help Forum 的帖子,Google 的 John Mu 说:

That usage [wrapping block-level elements in links] would be fine with us - we'd still pick up the link, and would be able to associate your text as an anchor with that. We're pretty flexible with parsing HTML, so you could probably even use this with HTML4. That said, the clearer you make your anchor text, the easier it is for us to understand the context of the link, so I wouldn't necessarily always use a whole paragraph as the anchor for all of your internal links.

简而言之,将整个元素包裹在 link 中会使 Google 难以理解 link 的上下文。