html – CSS / Less / Sass – 在以下情况下匹配每个兄弟姐妹:悬停

前端之家收集整理的这篇文章主要介绍了html – CSS / Less / Sass – 在以下情况下匹配每个兄弟姐妹:悬停前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在这段代码中:
<div id="Container">
  <span class='first'>First</span>
  <span class='second'>Second</span>
  <span class='third'>Third</span>
</div>

我希望在以下情况下改变颜色:悬停.

> IF(.first:hover)THEN .first {color:red; }
> IF(.second:hover)THEN .first,.second {color:red; }
> IF(.third:hover)那么.first,.second,.third {color:red; }

没有JS,这可能吗?我可以接受CSS Hacks 原文链接:https://www.f2er.com/html/227378.html

猜你在找的HTML相关文章