css - How it's possible add style on hover if element is an immediate previous of that element? -


a:hover + ul{  display:none;  }
<li>    <a>hover me</a>    <ul> hide me</ul>  </li>  <li>    <p>change color</p>    <ul>hover me</ul>  </li>

i know it's possible add style particular element using '+' if it's immediate next element(as shown above).is possible apply hover if element immediate previous ?

that not possible css selectors use kind of hack change order of elements flexbox , use + selector.

div {    display: flex;    flex-direction: column;  }  strong:hover + p {    color: blue;  }  p {    order: -1;  }
<div>    <strong>hover me</strong>    <p>change color</p>  </div>


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -