To achieve the specified requirement of changing the background color of the ul when hovering over any li except for .three, a pseudo before element can be utilized.
This code snippet adjusts the ul to position relative and assigns a before pseudo element that covers the full height and width of the ul upon hovering over any li except for .three, with absolute positioning.
As a result, the background color is effectively applied.
<style>
ul {
position: relative;
display: inline-block;
}
.promocode>li:not(.three):hover::before {
content: '';
position: absolute;
width: 100%;
height: 100%;
background: gray;
top: 0;
left: 0;
display: inline-block;
pointer-events: none;
z-index: -1;
}
</style>
<ul class="promocode">
<li>one</li>
<li>two</li>
<li class="three">three</li>
</ul>
Please note that this solution is tailored specifically for setting a background color in the given scenario, and may not be suitable for general selection purposes.