Some of my elements have a specific class called .option
, while others also have an additional class named .selected
. I want to add some style definition for the :hover
state on the .option
elements, but only for those without the .selected
class.
I've tried using the :not()
and :hover
pseudo selectors, but none of the combinations gave me the desired outcome.
On top of that, I need to implement this in Less. I'm not too familiar with Less and CSS.
<!-- I'd like to apply :hover only on those options that are not selected -->
<div class="option">
option 1
</div>
<div class="option selected">
option 2
</div>
<div class="option">
option 3
</div>
<div class="option">
option 4
</div>
After some trial and error, I realized that .option:not(.selected):hover
is the CSS selector I need...I just need help translating it into Less.