1

Devtools Image

DevTools

Problem

I tried changing the color of the background when adding the class checked to the object, but it won't change the color and just appears crossed out in devTools.

Code:

.doctheme .check { 
  position : relative;
  top      : -2.5px;
  width    : 30px;
  height   : 30px;
  left     : 45px;
  border-radius       : 50%;
  background-color    : #136;
  transition-duration : .4s;
  }
.checked {
  translate        : -42.5px;
  background-color : #FDA;
  }
Blue Robin
  • 847
  • 2
  • 11
  • 31
  • https://stackoverflow.com/help/how-to-ask – Mister Jojo Mar 20 '23 at 02:46
  • 3
    Please research your inquiry before posting. This is a duplicate of [How does the CSS specificity work?](https://stackoverflow.com/questions/31590652/how-does-the-css-specificity-work) – esqew Mar 20 '23 at 02:52
  • presumably for a matter of precedence, but how do you know, your small part of snippet is absolutely not significant to be able to understand or solve it. – Mister Jojo Mar 20 '23 at 02:55
  • 1
    Because `.doctheme .check` has a `background-color` property, so the value from the less-specific `.checked` is crossed out. – qrsngky Mar 20 '23 at 02:55

0 Answers0