简体   繁体   中英

Does inline CSS and JavaScript really affect site SEO?

内联CSS和JavaScript真的会影响网站SEO吗?

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.

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.

I don't think most spiders actually execute Javascript before parsing the page. If there's something you really want indexed, it's best to put it on the page as simple content. Bring it in via Ajax, constructing it on the fly via javascript, et. al, certainly will only hinder its SEO value. Tricky links that take form after being constructed by Javascript are also bad form -- a simple site map probably yields better value.

As noted in another answer, any content created or modified by JavaScript is unlikely to be 'seen' by the search engines. Although this of course applies wherever you place the JS.

Depending on the size of your page and the capability of your hosting it could affect indexing. If the extra load is sufficient to start slowing your server's response to page requests then the search engines will slow their spidering and, for a large site, may not manage to crawl the entire site on a timely basis.

Search Engine mainly read textual part of the website.But there are many factor that include that effects seo. Using table template, and even using inline css make the page load time a little more. even if you can check on html validators it marks all inline ccs as error.Slower responsive time for site.

javascript increases the site's load time. I believe that is how it may affect your site's rankings. Head over to https://developers.google.com/speed/pagespeed/insights/ and test your URL. Sometimes using javascript on the first view of your website delays the page load as content is displayed only after the script is rendered. That may hurt user experience and SEO.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM