There is a list with a sublist attached to it. Interested in how to use styles to make sure that when you hover on only a menu item with a sub-list, the area is highlighted in yellow - it is the entire area along with the item itself! Code and Fidl
ul { list-style: none; } ul.main:hover li.second.current, ul.main:hover ul { background-color: yellow; } .second { display: inline-block; background-color: #000; color: white; } .second.current { background-color: red; } <ul class="main"> <li class="second current">Пункт 1 <ul> <li>Подпункт 1</li> <li>Подпункт 2</li> <li>Подпункт 3</li> </ul></li> <li class="second">Пункт 2</li> <li class="second">Пункт 3</li> </ul>
ul.main:hover ul, is it the same? - borodatych