Color your links with specific href

CSS
Three examples of coloring anchor tags depending on the part of the URL

You can take advantage of CSS selectors to color different anchors with a different color! Look at the example; it's so simple.

  • [href^=] selects all anchors which href starts with the value

  • [href$=] selects all anchors which href ends with the value

  • [href*=] selects all anchors which href includes the value

Logo - Albert Walicki

Hello, I'm a frontend developer with over eight years of experience, freelancer. I'm also a mentor for junior frontend developers. I wrote a book for Junior Frontend developers called Frontend Unicorn.

© 2020-present Albert Walicki. All Rights Reserved

Policy