Forum Moderators: not2easy

Message Too Old, No Replies

CSS Embedded vs. Separate Style Sheet

         

Fortune Hunter

2:58 pm on Sep 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A question for those you far more versed in CSS than I am, do you have an opinion of which is better, to embed your CSS in the page or to put it in a separate style file?

My thought was putting it on the page would keep the link to the file from somehow getting severed, but then I started wondering if all of the extra code on the page hurt SEO efforts or there was some other disadvantage I wasn't aware of.

Philosopher

3:18 pm on Sep 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would say whenever possible, keep the css in a separate file. There are a number of advantages.

1) The text to code ratio on your pages will be lower.

2) There will be fewer chances of code errors throwing off the proper indexing of the page.

3) Each page will be much smaller in size thus requiring less time to load (the css file will only be loaded once..then cached by the browser).

4) Making future changes to your site design requires editing only the css file, not individual changes.