问题
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">
回答1:
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).)
回答2:
Well you have "text/css" in a script tag in all three, so I'd remove them for a start! :)
Adding rel=nofollow
to your stylesheet and script tags though will have no SEO benefit.
Interesting read.
来源:https://stackoverflow.com/questions/21196528/do-i-need-rel-nofollow-in-external-scripts-and-stylesheets