SEO& display:none [英] SEO & display: none

查看:155
本文介绍了SEO& display:none的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道类似的问题被问了一百万次,但我有一个关于SEO和CSS显示的一个真正具体的问题:没有。
我的理解是,从SEO的角度来看,使用display:none隐藏元素是可以接受的,只要你不想偷偷摸摸,并且有东西显示元素。 JavaScript / jQuery。
如果我的脚本没有具体显示这些元素怎么办?
我的意思是说我有以下:

I know similar questions have been asked a million times, but I have a really specific question regarding SEO and CSS display:none. My understanding is that, from an SEO point of view, it's acceptable to hide elements with display:none, as long as you're not trying to be sneaky and there's something that actually shows the element e.g. JavaScript / jQuery. What if my script doesn't specifically show these elements though? What I mean is say I had the following:

<a class="pin" id="cont1"></a>
<a class="pin" id="cont2"></a>

<div class="container" id="container1">
   <p>Some text</p>
</div>
<div class="container" id="container2">
   <p>Some more text</p>
</div>

容器div是显示:none并且点击pin定位器显示相关的div即pincont1 显示container1,cont2显示container2等。
然而,执行此操作的脚本不引用特定的div。相反,它将从锚点id的数字子串,以知道哪个div显示

The container divs are display:none and clicking on the pin anchors shows the relevant div i.e. pin "cont1" shows "container1" and "cont2" shows "container2" etc. However the script that does this doesn't reference a specific div. Instead it substrings the number from the anchor id to know which div to show i.e.

$('.pin').each(function () {
    $(this).click(function () {
        var contId = $(this).attr('id').substr($(this).attr('id').length - 1);
        var container = document.getElementById('container' + contId);
        if ($(container).css('display') == 'none') {
            $(container).fadeIn();
        } else {
            $(container).fadeOut();
        }
    })
});

基本上,显示/隐藏的元素是在脚本中计算出来的,实际的div id不是直接引用。
你认为这种方法会被Google处罚吗?这会被拾取为隐藏的内容,从来没有显示? (即使它实际上是)

Basically, the elements to show/hide are worked out in the script and the actual div id's are not referenced directly. Do you think this approach would be penalized by Google? Would this get picked up as hidden content which is never shown? (even though it actually is)

推荐答案

否。自从用CSS / JS隐藏内容之后,Google就改变了很多。只要你提供的内容,可见或不,是不是垃圾,或无用的链接,或废话,你是完全精致的隐藏的东西,当你需要。总之,如果内容在页面谷歌可以阅读它,所以唯一的损失,你可以做自己是无意义的内容。

No. Google has changed a lot since the days when hiding content with CSS/JS could dupe them. As long as the content you are serving, visible or no, is not spammy, or useless links, or nonsense, you are perfectly fine hiding things as and when you need to. Afterall, if the content is on the page Google can read it so the only disservice you can do yourself is pointless content.

这篇关于SEO&amp; display:none的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆