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

有时当我在网站上工作并且网页设计有类似盒子(网格商店的网格产品)时,我倾向于犹豫是否要将整个盒子作为链接.例如:

<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>

当这些类似盒子的元素是整个链接时,对我来说似乎更加用户友好,因为当在移动设备上时,点击一个小按钮就更难了.但是,我不相信这样做之后是否对搜索引擎优化没有负面影响.当一大块HTML被包含在< a>中时,我看起来很奇怪.标签.

很难找到关于这个问题的任何讨论,所以任何意见都表示赞赏.

最佳答案 这是
valid in HTML5,所以你可以在一个链接中包含块级元素.这是关于这个问题的
another article.

也就是说,谷歌仍然坚持这种做法.根据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.

简而言之,将整个元素包装在链接中会使Google难以理解链接的上下文.

点赞