搜索引擎是否将文本缩进:-9999em 或负边距视为 SEO 作弊?

发布于 2024-10-28 08:33:11 字数 237 浏览 5 评论 0原文

我想使用像 text-indent:-9999em 或负边距这样的技术来用更漂亮的图片替换我的文本,但我想知道搜索引擎是否会将此视为一种作弊?

我认为要让它知道这一点,它必须读取我的 CSS 文件,因此我可以使用 robots.txt 来禁止它读取我的 CSS 文件。如果可行,我也可以直接使用 display:none 吗?或者我可以使用 jQuery 代码来操纵某些 Web 元素的样式?

I want to use a technique like text-indent:-9999em or negative margin to replace my text with more pretty pictures, but I wonder if search engines would treat this as kinds of cheating?

I think for it to know this, it must read my CSS file, so I can use robots.txt to forbid it from reading my CSS file. If this works, can I also use display:none directly? Or I can manipulate some web-element's style by using jQuery code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

守望孤独 2024-11-04 08:33:11

您概述的技术(负边距/缩进)等是常见做法。

只要您不使用这些方法引入垃圾链接/文本,那么就没有问题 - 这完全取决于意图。谷歌(通过网站管理员视频中的代言人马特·卡茨)表示,如果可能的话,您应该尽量避免这种方法,并使用传统的替代文本作为内嵌图像等。

有许多不同的文本/图像替换技术,每种技术都有不同的用途您需要考虑的 UI/UX/SEO 影响。我推荐此资源作为起点(奖励 - 有一个指向“Google Impact”帖子的链接):http://mezzoblue.com/tests/revised-image-replacement/

The techniques you have outlined (negative margins/indents) etc are common practices.

As long as you're not introducing spammy links/text using these methods then you'll be OK - it's all about intent. Google has stated (via mouthpiece Matt Cutts in a webmaster video) that you should try to avoid this approach if possible and use traditional alternate text for inline images etc.

There are a number of different text/image replacement techniques floating around, each with different UI/UX/SEO impacts that you'll need to consider. I'd recommend this resource as a starting point (bonus - there's a link to a 'Google impact' post): http://mezzoblue.com/tests/revised-image-replacement/

窗影残 2024-11-04 08:33:11

这不应该是一个问题:正如其他人在回答中所说,这种技术已被网络开发人员广泛用于图像替换,因此搜索引擎不太可能将其视为作弊。

然而,值得注意的是,现在已知使用大量文本缩进(例如 -9999em)会导致性能问题,因为它要求浏览器在使用此技术的每个元素周围绘制一个巨大的框。有关实现相同效果的一些更好、更简洁的方法,请参阅我的回答这个问题

This shouldn't be a problem: as others have said in their answers, this sort of technique has been so widely used by web developers for image replacement that it's highly unlikely to be treated as cheating by search engines.

However, it's worth noting that the use of massive text-indents (like -9999em) is now known to cause performance problems because it requires the browser to draw a huge box around every element that uses this technique. For some better, cleaner ways of achieving the same effect, see my answer to this question.

云朵有点甜 2024-11-04 08:33:11

对于友好的CSS隐藏内容而不影响SEO,建议这样做:

.divToHide{
    position:absolute;
    top:-9999;
    left:-9999;
}

我在我的网站中使用它,你可以查看 css-tricks 网站了解更多信息

For Friendly CSS Hiding contents without affect SEO, it's recommended to do it like below:

.divToHide{
    position:absolute;
    top:-9999;
    left:-9999;
}

I'm using it in my site, you can see css-tricks site for more information

梦醒灬来后我 2024-11-04 08:33:11

好吧,你可以隐藏文本(使用CSS文本缩进,不显示,不需要阻止CSS),只要它不误导/垃圾邮件,谷歌就可以。但是,如果页面上的隐藏文本多于可见文本,那么这不是一个高质量的信号。您的网站(如果它对某些谷歌流量来说很重要/符合条件)可能会被人类质量审核员标记和访问(如果您的网站在其他方面还不错的话,这并不是什么大事)。

ok, you can hide text (with css text indent, with display none, no need to block the css) and it is ok for google as long as it is not misleading / spammy. but if you have a lot more hidden text on a page then visible text then this is not a good quality signal. your site (if it is in any way important / eligible to some google traffic) will then probably get flagged and visited by a human quality reviewer (which is not a big thing if your site is otherwise ok).

泛滥成性 2024-11-04 08:33:11

谷歌和雅虎对此都没有明确的正确或错误的回应!或 Bing,但正如 Mike 正确指出的那样,长期以来,这一直是开发人员的常见做法,作为添加徽标或自定义标题的一种方式,其中字体无法使用 CSS 进行处理(想想 PhotoShop 中清晰的文本样式或使用不支持的字体)已获得 @font-face 使用许可)。

只要它没有在您的网站上大量使用(坚持徽标和标题而不是正文)并且隐藏文本没有过多的关键字,您就可能没问题。看看 google.co.uk,你会发现他们用 visibility:hidden;

需要考虑的一个重要事项是可访问性。可访问的网站对 SEO 更友好,因为每个人都可以访问内容。如果有人打开 CSS 但关闭图像,您的网站仍然可用吗?这并不罕见,而且随着移动设备使用量的增加,人们可能会这样做以降低数据成本。

There's no clear right or wrong response on this from either Google, Yahoo! or Bing but, as Mike rightly put, this has been common practice by developers for a long time as a way of adding logos or custom headings where fonts have treatment not possible with CSS (think text style crisp in PhotoShop or with fonts that aren't licenced for @font-face use).

As long as it isn't heavily used across your site (stick to logos and headings not body copy) and the hidden text doesn't have excessive keywords you're likely to be ok. Take a look at google.co.uk and you'll see they hide the h1 on there with visibility: hidden;

An important thing to consider is accessibility. Accessible sites are more SEO friendly because the content is available to everyone. Would your site still be usable if someone had CSS turn on but images turned off? It's not an uncommon thing and, with mobile use increasing, people may do this to keep data costs down.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文