我需要rel =“nofollow”吗?在外部脚本和样式表? [英] Do I need rel="nofollow" in external scripts and stylesheets?
问题描述
我已经阅读了很多关于搜索引擎优化和网络性能的内容,但现在我有一个愚蠢的问题,我正试图回答自己,但我不能。很好地使用 rel =nofollow
在许多情况下改进搜索引擎优化,它是众所周知和记录的。
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.
如果我有外部样式表(.css)和脚本(。 js)不在我的网站上托管,我是否需要使用 rel =nofollow
来改善SEO?
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?
假设我的网站 Google 。如果我的页面中包含以下内容:
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">
哪一个更好:
<!-- 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建议在Stack Overflow上是偏离主题的。但是你的问题仍然可以在这里得到解答,因为......
SEO advice is off-topic on Stack Overflow. But your question can still be answered here, because …
在HTML5中, nofollow
链接类型只能与一起使用a
和区域
元素。
In HTML5, the nofollow
link type may only be used with a
and area
elements.
所以不要使用它在链接
元素。
So don’t use it on link
elements.
对于 脚本
元素,否<$ c首先是$ c> rel 属性。
For script
elements, there is no rel
attribute in the first place.
(注意:您的脚本
元素的类型
值 text / css
。这可能不是你想要的。如果这是JavaScript,使用 text / javascript
(或省略类型
属性。)
(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 =“nofollow”吗?在外部脚本和样式表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!