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

Is Z-index based tab content more SEO friendly than display:none?

· 52CE 我爱测

I've created a quick proof of concept in codepen which I'd like some advice on. Would this be more SEO friendly than tabbed content using display:none ? I'm not looking to get on the wrong side of Google, and would like some info…

问题原文

原帖链接 · Sharper · CC BY-SA 3.0

I've created a quick proof of concept in codepen which I'd like some advice on. Would this be more SEO friendly than tabbed content using display:none?

I'm not looking to get on the wrong side of Google, and would like some informed opinion on this before I move past a quick pen.

http://codepen.io/sharperwebdev/pen/LkzarX?editors=1111

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 3.0

The technical means used to hide content is not important at all to Google. Google can detect a variety of mechanisms used to hide text:

  • display:none
  • visibility:hidden
  • zIndex
  • Text color matching the background color
  • Moving an element off screen

Google will only penalize a site for hidden text in cases where the site is trying to deceive Google into indexing content that not seen by users. Hiding content in a tab that users can easily click to see will not get a site penalized, regardless of the technical means used to hide tabs.

On the other hand, Google usually chooses not to index text that isn't visible on the page when it loads. Even if Google does index it, it is unlikely to rank well for its keywords. It doesn't matter what technical means you use to hide text, hidden text has little SEO value.

If the text is important enough to have indexed and ranked in search engines, you need to put it on its own page. Clicking on the tab should change the URL. Users coming into this unique URL would need to see the contents of that tab.

Assigning a tab to a URL does not necessarily preclude using JavaScript to show and hide tabs. When JS shows and hide tabs, the JS can use pushstate to change the URL. When the page loads, the correct tab can be shown either server side, or client side based on the URL.

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

资料来源与适用范围

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

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

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