html - 搜索引擎是否将可点击的 div 视为链接

标签 html seo

我正在开发一个新网站,我想使用可点击的 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/

相关文章:

javascript - 我的 HTML-Javascript 连接出了什么问题?

html - 我如何使用 CSS 来选择和设置所有具有 UL 子元素的 LI 元素的样式?

javascript - jQuery、AJAX : Make part of a page ( <div> ) not refresh on website navigation

php - 如何从此URL“http://localhost/blog/public/post?id = 2”中删除“?id =”?

javascript - Div 不会居中

html - 为什么这段文字会移动我的 div?

php - 谷歌会索引我的 "getdata.php"文件吗?

html - 搜索引擎可以跟随 <button> 或 &lt;input&gt; 元素吗?

url - 短网址冲突。更喜欢项目还是项目列表?

ASP.NET MVC 5 URL 取决于选择