Logo - Albert Walicki

Color your links with specific href

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

See more tips!

Example of styling first line of the element

Target first line of sentence

Logo - Albert Walicki

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

BlogGlassmorphismAurora UIShapes in CSSUnique css illustrations

Get in touch!

Have a question or need a project? Contact me!

© 2020-present Albert Walicki. All Rights Reserved