我正在开发一个新网站,我想使用可点击的 div 而不是普通链接:
这是我使用的代码:
<div class="css-class" onclick="location.href='http://example.com/page'" title="Some text">
Some clickable content
</div>
Google 和其他搜索引擎会像看到普通链接一样看到可点击的 div 吗?
换句话说,他们是否能够抓取 http://example.com/page
页面?
最佳答案
根据 this page :
Since 2009 Google looks for and finds OnClick links in any and all HTML tags. When found they will add the URL to their crawl.
If there is sensible "anchor" text then the text of the element will be used as anchor text.
The OnClick link also passes PageRank.
然后它继续提到其他搜索引擎还没有这样做。 (写于 2014 年 10 月)
关于html - 搜索引擎是否将可点击的 div 视为链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35544452/