大网数据广告活动
网站运营与故障问答

Is it okay for SEO to wrap block elements in a link?

· 52CE 我爱测

We have a request to have an entire block of content be clickable as opposed to just a link field. Questions: Is it good practice to allow for entire block of content to be clickable? If we wrap content with link, does that ding …

问题原文

原帖链接 · usernameabc · CC BY-SA 4.0

We have a request to have an entire block of content be clickable as opposed to just a link field.

Questions:

  1. Is it good practice to allow for entire block of content to be clickable?
  2. If we wrap content with link, does that ding our SEO page rankings?

Example:

  • Link only clickable

    <div>
      <img src="https://placeimg.com/640/480/arch">
      <p>Appropriately initiate front-end "outside the box" thinking via flexible intellectual capital.</p>
      <a href="https://placeimg.com/640/480/nature">My Link</a>
    </div>
    
  • Entire block element clickable

    <a href="https://placeimg.com/640/480/nature" title="My Link">
      <div>
        <img src="https://placeimg.com/640/480/arch">
        <p>Appropriately initiate front-end "outside the box" thinking via flexible intellectual capital.</p>
      </div>
    </a>
    

已采纳解答

原帖链接 · Maximillian Laumeister · CC BY-SA 4.0

Yes, it is fine and even advisable to put block elements inside an a element where appropriate, as long as the browser supports HTML5 (all modern browsers do):

The a element may be wrapped around entire paragraphs, lists, tables, and so forth, even entire sections, so long as there is no interactive content within (e.g. buttons or other links).

Text-level Semantics - w3.org

Search engines and browsers will both understand the links just fine.

Further reading:

Is putting a div inside an anchor ever correct? - Stack Overflow

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2018-12-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。