Dynamically change color to lighter or darker by percentage CSS (Javascript)

后端 未结 24 1738
-上瘾入骨i
-上瘾入骨i 2020-11-28 01:12

We have a big application on the site and we have a few links which are, let\'s say blue color like the blue links on this site. Now I want to make some other links, but wit

24条回答
  •  無奈伤痛
    2020-11-28 01:46

    Use the filter pure CSS property. for a complete description of the filter property functions read this awesome article.

    I had a same issue like yours, and I fixed it by using the brightness function of filter property:

    .my-class {
      background-color: #18d176;
      filter: brightness(90%);
    }
    

提交回复
热议问题