Welcome to WebmasterWorld Guest from

Message Too Old, No Replies

Descriptive CSS Tags for GoogleBot - For better indexation?



12:35 pm on May 8, 2013 (gmt 0)

10+ Year Member

I was checking the HTML code for some popular websites and noticed that they used descriptive names for css styles.

For eg -

Title would <h1 class="title"
Post matter would be <div class="entry-content"> which would end with - </div><!-- end .entry-content -->

Is this something that is done specifically for the Google Bot? How else would Google differentiate content except for the H1, H2 and H3 tags.

If not then, what are the best practices for style naming convention for a content heavy website?


1:47 pm on May 8, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

Google recommend 'meaningful' style names - [google-styleguide.googlecode.com...]

Whether or not they give any brownie points for doing this is another matter.


6:46 pm on May 8, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

Hard to tell in isolation. Are you saying that the sites consistently apply class names to an element when there's only one of it?

Normally there would not be more than one <h1> per page. So you'd only have classes if you're using a shared stylesheet. For comparison purposes, one of my directories has <body class = "some-color"> so I don't need a separate background-color declaration in every document.

Class names should be intelligible to the person reading the code-- and to the next person coming along later. That means, no "class = 'sc'" or "class = 'g1'" and the like. I once processed an e-book whose creator had named all his css classes in Esperanto. (This is really true.) Made sense to him, I'm sure, but...

Whoops! This isn't the CSS forum is it?

Now, if you've got a "div class = 'invisible'", a savvy search engine would take a quick look at the CSS and see if there's a {visibility: hidden;}. And then set off the Cloaking buzzers.


8:39 pm on May 8, 2013 (gmt 0)

Best practices? Make it easy for *you* to understand your markup at a glance. I'd name your sidebar div sidebar, your header div header, your footer div footer, and your content div content. It just makes sense...

Maybe doing this also makes it easier for Google to identify the elements of your site, but I doubt they need much help there at this point.

Featured Threads

Hot Threads This Week

Hot Threads This Month