I have a three types of boxes being displayed in the image (2,3, and 4)
The first element is the selected style of a box.
I would like to apply this selected style on the other three.
- For 2 it is straight forward. The gray goes to black.
- For 3 I would need to replace the dashed with a solid line.
- For 4 I would replace the gray with the black, but I would want to keep the image.
However I am trying to understand how it would work with inheritance in CSS. I am just adding a class 'active' to mark it as selected. It works fine for 2, but for 3 and 4 it does not know how to process the order of class names. I cannot remove the classes of the elements, because obviously I want to cascade the changes through (like the image in option 4).
My CSS looks like this :
li {
padding: 0.125rem;
margin: 0.4375rem 1.0625rem 0.3125rem 0;
border: 0.0625rem solid #d9d9d9;
}
li.active {
border: 0.0625rem solid black;
}
li.sold {
display: inline-block;
border: 1px solid #ccc;
background: url(http://i.piccy.info/i7/c7a432fe0beb98a3a66f5b423b430423/1-5-1789/1066503/lol.png);
background-size: 100% 100%;
}
li.wait-list {
display: inline-block;
border: 1px dashed #ccc;
}
I have demonstrated this in a JSFiddle :
https://jsfiddle.net/561aLm4z/7/
It's probably an obvious question, but how do I get the 'active' style to overwrite the styles on box 3 and 4?