最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - SEO for CSS hide JS fade-in - Stack Overflow

programmeradmin1浏览0评论

I have an image that I want to fade in once the page loads.

I have set the css for that image to have zero opacity.

I then use js to fade the image in (increment the opacity to 1). This happens within about a second of the page loading.

I can imagine that elements with zero opacity won't add value to the SEO. However I know that the google crawler can read JS to some extent. Does this mean that it will understand that it is visible after a second and index it like any regular image?

Also how would the SEO be affected if I replaced the opacity with 'display:none' at page load and 'display: block' with JS a second later?

Any insight would be appreciated, cheers!

I have an image that I want to fade in once the page loads.

I have set the css for that image to have zero opacity.

I then use js to fade the image in (increment the opacity to 1). This happens within about a second of the page loading.

I can imagine that elements with zero opacity won't add value to the SEO. However I know that the google crawler can read JS to some extent. Does this mean that it will understand that it is visible after a second and index it like any regular image?

Also how would the SEO be affected if I replaced the opacity with 'display:none' at page load and 'display: block' with JS a second later?

Any insight would be appreciated, cheers!

Share Improve this question edited Feb 28, 2012 at 22:07 animuson 54.8k28 gold badges142 silver badges150 bronze badges asked Jun 3, 2011 at 15:30 Paul MasonPaul Mason 1,8182 gold badges20 silver badges33 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 12

SEO is a dark art. The only people who can answer this question accurately will be Google's engineers, and they won't answer it. There are a lot of "SEO experts" who will bluff you that they know the answer, but the truth is that they're all of them making educated guesses.

My answer to the question follows, but bear in mind the above -- I am only making an educated guess.

Stuff like this is an edge case; if your page is well written and semantic then even if details like this do have an effect, it will be drowned out by the much more heavily weighted effect of the actual content.

In any case, the use of opacity and visibility in conjunction with dynamic content is so mon these days that Google must be aware of it and factor it into their algorithms. Therefore I don't believe this will affect you. But to reiterate, this is an educated guess.

Replacing opacity with display styles shouldn't affect your SEO; but I do remend the display:none, display:block option over opacity for more browser-patibility. I'm not sure what the Crawler can read, but using opacity shouldn't hurt your image. If you want to add more SEO to it, add <figure> and or <figurecaption> around your image. and don't forget the alt and title attributes (nix title if you're using figcaption).

I'm pretty sure that this works well with seo:

<span style="text-indent: -9999px">
  This will not be visible on screen but readable by a crawler
</span>

and this should also work

<div style="position: relative; left: -9999px">
  This will not be visible on screen but readable by a crawler
</div>

But I do understand that these two techniques might not work in your specific case.

发布评论

评论列表(0)

  1. 暂无评论