css-selectors

CSS: style nth sibling [duplicate]

一个人想着一个人 提交于 2020-08-24 06:24:58
问题 This question already has answers here : css nth child from element with class (2 answers) Closed 3 years ago . Is it possible to style the nth sibling in pure CSS? For example, can we style 4-th or 5-th .child when hover on 1-st .child ? <div class="parent"> <div class="child"> 1 </div> <div class="child"> 2 </div> <div class="child"> 3 </div> <div class="child"> 4 </div> <div class="child"> 5 </div> </div> update I guess my question was not correct a bit. Excuse me for that. I meant can I

CSS: style nth sibling [duplicate]

给你一囗甜甜゛ 提交于 2020-08-24 06:24:51
问题 This question already has answers here : css nth child from element with class (2 answers) Closed 3 years ago . Is it possible to style the nth sibling in pure CSS? For example, can we style 4-th or 5-th .child when hover on 1-st .child ? <div class="parent"> <div class="child"> 1 </div> <div class="child"> 2 </div> <div class="child"> 3 </div> <div class="child"> 4 </div> <div class="child"> 5 </div> </div> update I guess my question was not correct a bit. Excuse me for that. I meant can I