12

When google crawls a web page , do google bot crawl

  1. content with code like style="display:none"

  2. content with code like style="display:block"

the question i am asking because i have a website of F&Qs.

  1. For user i want answers to be displayed only when he clicks on "answer/solution" link.

  2. For google bot i want solution section to be crawled else my content of page becomes too less.

chicharito
  • 1,016
  • 3
  • 10
  • 37
  • Have a look through these answers too: http://webmasters.stackexchange.com/search?q=google+hidden – Kev Sep 19 '12 at 00:04

2 Answers2

12

Yes google will see content that is both display none and display block

Your FAQ section will be seen by google bots.

See these articles:

Webmaster Guidelines: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35769

Use a text browser such as Lynx to examine your site, because most search engine spiders see your site much as Lynx would. If fancy features such as JavaScript, cookies, session IDs, frames, DHTML, or Flash keep you from seeing all of your site in a text browser, then search engine spiders may have trouble crawling your site.

Hidden text and links: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=66353

Hiding text or links in your content can cause your site to be perceived as untrustworthy since it presents information to search engines differently than to visitors. ... If you do find hidden text or links on your site, either remove them or, if they are relevant for your site's visitors, make them easily viewable.

zamnuts
  • 9,004
  • 3
  • 33
  • 44
0

It is debatable if Google does crawl hidden elements; you'll find 'experts' who will argue one way or another, however most of it is pure conjecture. What I like to do in these situations is apply the display: none via JavaScript / jQuery on $(document).ready() that way the user gets the experience you are looking for, while Google indexes the page like so:

<div class="question">Does Google see this?</div>
<div class="answer">Yes is JS is used!</div>

$(document).ready(function(){
    $('.answer').hide();
});

It is important to note that this method is also debatable as some have indicated that Google has started executing JS as part of the crawl. That being said, I've had good results using this technique.

I hope this helps!

dSquared
  • 9,417
  • 5
  • 35
  • 53
  • 1
    javascript need to be loaded at the end , so user might see hidden text first and then it will get hidden.seems bad ui ? – chicharito Sep 18 '12 at 18:27
  • [The Googlebot has been using JavaScript and jQuery for a while](http://stackoverflow.com/questions/6586934/can-search-engine-spiders-see-content-i-add-using-jquery/6587142#6587142). – Sparky Sep 18 '12 at 18:31
  • @Sparky672 Makes perfect sense with all the AJAX built sites out there. I wonder if processing the JS also means it looks at CSS styles it applies. – dSquared Sep 18 '12 at 18:34
  • @chicharito Good point; I usually leave everything in place and then animate it closed to give it a nice effect like this: http://jsfiddle.net/DARqs/1/ Although Sparkty672 raised a good point. – dSquared Sep 18 '12 at 18:40
  • Regarding Googlebot "looking at" CSS: I don't think it matters. If it ignores CSS, then it just sees CSS hidden content openly in the HTML. If it pays attention to CSS hidden content, then it's aware of its existence and therefore still sees content within the HTML. – Sparky Sep 18 '12 at 19:57