The main problem is that , unfortunately, you cannot style the parent element in any way from the point of view of the child selector (with or without :hover ) in CSS. See here for the answer here .
You can only stylize children according to the selectors of your parents or siblings according to the choices of others.
However, there are, of course, easy ways to achieve this with javascript / jQuery.
but not in LESS, since its output is CSS, so the above limitations apply again.
But fortunately, some properties of children affect some properties of their parents ... therefore, by placing children, you will also affect the parent. If the child element (block) is relative to the parent (block), the height parents must adapt to the height (including padding , margin and border ) of the child, without having to do something really special for the parent.
Demo
.parent { width:200px; background:orange; } .child { background:red; width:100px; height:100px; } .child:hover { height:200px; }
<div class="parent"> <div class="child"></div> </div>
source share