Forum Moderators: open

Message Too Old, No Replies

Google and css sheets

         

Giles Palmer

9:51 am on Sep 13, 2004 (gmt 0)

10+ Year Member



Does google read external style sheets?
Does google read code between <script>?

I presume it reads neither. Am I right?

Pass the Dutchie

12:56 pm on Sep 13, 2004 (gmt 0)

10+ Year Member



Google most probably read them but they may not (for now) be taken into consideration. I would assume that CSS and scripts are spidered and noted.

diamondgrl

1:10 pm on Sep 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If it doesn't read them, you can play all kinds of games with invisible text, etc. which Google hates. My guess is, without evidence, that Google reads and tries to interpret them.

encyclo

1:10 pm on Sep 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Googlebot has been known to fetch CSS files, but it is not clear that it is parsing them (yet). I've never seen it is fetching external Javascript files, but I believe if you include an URL in a script block on a page, it may be followed by Googlebot.

Critter

2:40 pm on Sep 13, 2004 (gmt 0)

10+ Year Member



I would *assume* that Google parses CSS, as it's a much easier language to parse than, say HTML, which we know they already parse. Matching an "id" or "class" tag in the HTML to the CSS file would be *trivial*.

Even taking into consideration positioning I think that developing a bot that would figure out foreground/background colors for a particular element wouldn't be that difficult.

One or two days of coding for me--tops.

Bonusbana

2:57 pm on Sep 13, 2004 (gmt 0)

10+ Year Member



If you put your external CSS in another directory, and then block that directory from google using robots.txt or a referal script, i cant see how google could ever find out about what goes on in your stylesheet.

Critter

3:20 pm on Sep 13, 2004 (gmt 0)

10+ Year Member



I think that Googlebot would probably figure out that, if it can get your content pages, but not your css page, something funny's going on.

BillyS

3:23 pm on Sep 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm also interested in this topic since I use CSS (and PHP).

I recently noticed that some websites using the same CMS tool that I use insert a h1 tag in addition to the normal CSS tag. When I look at the Google cache (text cache) of their websites, I noticed the BIG font typical of h1 and sure enough there it was in the HTML.

When I examine my website in Google's text cache, all of the letters are the exact same size, regardless of the CSS style applied. I changed the code to include h1 (and defined h1 in the CSS description) just this past Saturday and applied it to my "headers" on the page. The page Google grabbed on Sunday shows the cache text headers now as h1.

To me (a newbie to SEO), I thought this change was essential because it meant that Google had not been understanding my CSS and didn't recognize Header text from the rest of the page's content.

jetboy_70

4:21 pm on Sep 13, 2004 (gmt 0)

10+ Year Member



While technically Google would be able to parse CSS without a problem, it would have great difficulty in passing out fair penalties for spam. There are so many methods of hiding content, and all of them have legitimate uses, including making graphically heavy sites accessible to screen readers.

Googlebot certainly does fetch CSS files. If you use a web page extension instead of .css (such as .asp or .php) for external CSS files you'll find them listed in Google's SERPs.

Bonusbana

4:35 pm on Sep 13, 2004 (gmt 0)

10+ Year Member



I still think its easy to hide your CSS file from google, either with the robots.txt mod I suggested before, or simply add a php referer script in your CSS file and serve whatever alternate CSS to googlebot only.

Still, hiding text could be subject of googles TOS, but Im sure there will always be ways of manipulating the path for googleBot to take (or not to take).

bumpski

5:31 pm on Sep 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've reviewed lots of log entries for my websites. When Googlebot/2.1 crawls the site it doesn't fetch my CSS file. I've got a small write up reviewing the logs of 3 google crawls of one of my sites. Google Crawl log review [bobshowto.com]. If somebody put a link to a CSS file in a web page then I'm sure Google would index it and it would show up in the SERPs. I've noticed numerous top ranked sites (SERPS) use embedded styles and no CSS, I've wondered if Google does have a bias toward embedded styles since as mentioned before you definitely can spam using CSS.