我需要 rel="nofollow"在外部脚本和样式表中? [英] Do I need rel="nofollow" in external scripts and stylesheets?

查看:23
本文介绍了我需要 rel="nofollow"在外部脚本和样式表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了很多关于 SEO 和网络性能的文章,但现在我有一个愚蠢的问题,我想自己回答,但我做不到.在许多情况下,可以很好地使用 rel="nofollow" 来改进 SEO,这是众所周知的并有记录.

但现在需要考虑:

如果我的网站中没有托管外部样式表 (.css) 和脚本 (.js),我是否需要使用 rel="nofollow" 来改进 SEO?><小时>

示例:

假设我的网站是 Google.如果我的页面中有以下内容:

<script href="http://www.chucknorris.com/youWillDie.min.js" type="text/javascript">

哪个更好:

<link href="http://www.blabla.com/myAwesomeStylesheet.css" rel="stylesheet" type="text/css"><script href="http://www.chucknorris.com/youWillDie.min.js" type="text/javascript"><!-- 第二种方式--><link href="http://www.blabla.com/myAwesomeStylesheet.css" rel="nofollow" type="text/css"><script href="http://www.chucknorris.com/youWillDie.min.js" rel="nofollow" type="text/javascript"><!-- 第三种方式--><link href="http://www.blabla.com/myAwesomeStylesheet.css" type="text/css"><script href="http://www.chucknorris.com/youWillDie.min.js" type="text/javascript">

解决方案

SEO 建议与 Stack Overflow 无关.但是您的问题仍然可以在这里得到解答,因为……

在 HTML5 中,nofollow 链接类型 只能与 aarea 元素一起使用.

所以不要在 link 元素上使用它.

对于script元素,首先没有没有rel属性.

(注意:您的 script 元素具有 typetext/css.这很可能不是您想要的.如果是JavaScript,使用 text/javascript (或省略 type 属性).)

I already read a lot about SEO and web performance, but now I have a dumb question that I'm trying to answer myself, but I can't. Is good use rel="nofollow" in many cases for improve SEO, it's well knowed and documented.

But now a thing to think:

If I have external stylesheets (.css) and scripts (.js) that doesn't is hosted in my website, do I need use rel="nofollow" to improve SEO?


Example:

Supose that my website is Google. If I have the following content inside my page:

<link href="http://www.blabla.com/myAwesomeStylesheet.css" type="text/css">
<script href="http://www.chucknorris.com/youWillDie.min.js" type="text/javascript">

Which one is better:

<!-- First way -->
<link href="http://www.blabla.com/myAwesomeStylesheet.css" rel="stylesheet" type="text/css">
<script href="http://www.chucknorris.com/youWillDie.min.js" type="text/javascript">

<!-- Second way -->
<link href="http://www.blabla.com/myAwesomeStylesheet.css" rel="nofollow" type="text/css">
<script href="http://www.chucknorris.com/youWillDie.min.js" rel="nofollow" type="text/javascript">    

<!-- Third way -->
<link href="http://www.blabla.com/myAwesomeStylesheet.css" type="text/css">
<script href="http://www.chucknorris.com/youWillDie.min.js" type="text/javascript">

解决方案

SEO advice is off-topic on Stack Overflow. But your question can still be answered here, because …

In HTML5, the nofollow link type may only be used with a and area elements.

So don’t use it on link elements.

For script elements, there is no rel attribute in the first place.

(Note: Your script element has the type value text/css. It’s likely that this is not what you want. If it’s JavaScript, use text/javascript (or omit the type attribute).)

这篇关于我需要 rel=&amp;quot;nofollow&amp;quot;在外部脚本和样式表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆