how to tackle rel="nofollow" using css

Discussion in 'HTML & Website Design' started by jtpratt, May 30, 2007.

  1. #1
    so I want to add the nofollow tag to some links. I think I can achieve this with some css code maybe. I find a snippet like this:

    a[rel~="tag"]::after {
    content: url(http://www.technorati.com/favicon.ico);
    }

    Let's say I have a div like:
    <div id="sidebar">
    <a href="http://affiliate.com">nofollow link</a>
    </div>

    rather than go in and hardcode a rel="nofollow" to all the sidebar links, I want to just add it in there to all sidebar links using css. Can I bastardized the snippet above to do some kind of 'a.sidebar' style to add the nofollow?

    thx!
     
    jtpratt, May 30, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    That would be a valueless approach. The rel="nofollow" is an instruction to the search bots. But the bots don't apply css, so the generated content would not be seen by the bots. The same applies to using javascript to add the attribute.

    cheers,

    gary
     
    kk5st, May 30, 2007 IP
  3. CygnetGames

    CygnetGames Peon

    Messages:
    43
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Because search bots don't apply css or any client-side scripting, you would have to do something on the server side - like using PHP to put a rel="nofollow" into your sidebar links.
     
    CygnetGames, Jun 1, 2007 IP