krzyhub
krzyhub

Reputation: 6540

Specifying other color for link to my site pages and other for external links

Dose somebody know that is solution for my problem?

Upvotes: 0

Views: 96

Answers (2)

arie
arie

Reputation: 18982

This can also be done with pure css.

Some further possibilities are explained in this post.

Upvotes: 0

code_burgar
code_burgar

Reputation: 12323

This should be fairly easy to accomplish with some JavaScript. If you aren't comfortable with JavaScript, you can always look for existing solutions in the form of a plugin for jQuery, or whichever your JS library of choice is.

jQuery example:

  $("a[href^=http]").each(
    function(){
      if(this.href.indexOf(location.hostname) == -1) {
        $(this).addClas('colored');
      }
    }
  )

Upvotes: 1

Related Questions