Welcome to WebmasterWorld Guest from 54.196.232.162

Message Too Old, No Replies

Does Google index show/hide text?

     
11:07 pm on Oct 20, 2007 (gmt 0)

New User

5+ Year Member

joined:July 6, 2007
posts: 12
votes: 0


I have a page on which I want to put a section of text and links on that are hidden by default but appear when the user clicks a link to show the hidden area. I'd like to do this by wrapping it in something like <div style="display: none;">....</div> and having some javascript change the style to display: block when the user clicks the "show" link. Will Googlebot see this hidden text and index the links within it?

Is there a recommended way of setting the style in the div? Does it matter to Google whether I set the style right in the div or have a CSS style declared in the file or should it be in an external stylesheet? Or will Google index it no matter which way it's done? Thanks.

12:04 am on Oct 21, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


This is the kind of coding that creates many dhtml menus. There's no problem with it when obvious user action makes the content visible, and the content in the initially hidden divs does get indexed.
12:08 am on Oct 21, 2007 (gmt 0)

New User

5+ Year Member

joined:July 6, 2007
posts: 12
votes: 0


OK, thanks...I just wanted to make sure because I've seen many people speculating on forums that you could get penalized for having text within hidden divs but I too have seen other sites use it for navigational menus. Obviously I'm not trying to spam -- I'm trying to create a useful functionality.
1:19 am on Oct 21, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


I've been using this show/hide div approach for 4 years on one site - it offers extended product information for visitors who are interested. It's been working beautifully there, both for the visitor and for the search engines.