Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does inline CSS and JavaScript really affect site SEO?

Does inline CSS and JavaScript really affect site SEO?

like image 593
Jitendra Vyas Avatar asked Feb 10 '10 21:02

Jitendra Vyas


People also ask

Does inline CSS affect SEO?

Yes, it does. For SEO, the page loading speed of the website is one of the important factors to determine the SEO ranking. With inline CSS, when page is being loaded, for every line the CSS will be applied, instead if you put a separate CSS file and use classes to style elements, the page load time too will reduce.

Why inline CSS is not recommendable?

Inline styles, while they have a purpose, generally are not the best way to maintain your website. They go against every one of the best practices: Inline styles don't separate content from design: Inline styles are exactly the same as embedded font and other clunky design tags that modern developers rail against.

Does inline CSS affect performance?

Ultimately, it's important in terms of inlining CSS and performance that you don't just dump all the CSS for your site into the head. If you inline too much, the performance implications will be worse than what you started with.


2 Answers

Hardly. What counts for a search engine is textual content, it will filter out everything else.

I assume CSS comes into play with search engines when they determine whether a portion of text is visible on the page, or hidden for the purposes of SEO. But even there, whether the CSS inline or in a style sheet won't make a difference.

One could argue that the more CSS and JS a page contains, the less weight do search terms have on that page. But I think that argument is invalid, because any non-content content will simply be ignored altogether.

like image 85
Pekka Avatar answered Sep 29 '22 23:09

Pekka


Answered and voted for by true developers.

In-line CSS will contribute to the payload of the page and that affects the load speed. Load speed is one of many ranking factors so it's almost an impossible question to answer conclusively.

The text to code ratio also plays a role. Tons of code to render a few lines of visible text means that search engines need to dig deeper to find the content relevancy in pages. Matt Cutts has alluded to this a few times.

While search engines may ignore comments and in-line css/js the bandwidth, processing and storage logistics may be motivation enough to dampen the SEO performance to some degree on heavy in-line css pages.

Personally I use in-line code only when absolutely page specific scenarios require it and even then I use css compression tools to reduce white space in the documents when ready for production.

I have had this conversation on many occasions and no neither side is conclusive. My simple answer is, if it "could" be detrimental then why risk it.

like image 28
Douglas Kemp Avatar answered Sep 29 '22 23:09

Douglas Kemp