Forum Moderators: phranque

Message Too Old, No Replies

SEO and CSS Definitions on Page

         

Fortune Hunter

3:01 pm on Dec 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I wanted to collect a few opinions on a topic I have been wondering about. I am setting up a new web site and on the home page I am doing some different stuff with the CSS so it looks different than sub pages and I was going to put the CSS in the header of the document as opposed to a separate style file since it is just for the this one page.

I was going to create a style file for all the sub pages since I could then change parameters in that one document and carry it through the whole site accept for home page.

My question is does all the extra code for CSS definitions in the header hurt your SEO efforts on the home page, which generally seems to be the page picked up most often by SE. There is just a lot of code up there in that header and several SEO consultants that seem to agree that too much code in the header, i.e. JavaScript etc. hurts your efforts because the spiders don't want to wade through all of that to index the page properly. I wasn't sure if this also applied to all the CSS definitions in the header as well.

Just wanted some opinions to see what others thought.

phranque

3:39 pm on Dec 16, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I think you should do what is better for the visitor which means trading off between page size and and the number of requests.
my guess is that there is little cacheing advantage for a separate css file used on one page, although it may help for returning visitors.
if your css code is huge you may want to rethink your implementation, for example using contextual selectors.
you might consider using a timing tool such as Yslow! to test the difference.