0

So, there is a page that has a structure like this:

<div id="parent">
<div></div>
<video id="need_to_select"></video>
<div></div>
<div class="some_class"></div>
</div>

I want to style the video element based on a class of an element which has the same parent. Problem is, the element with the class comes after the video element.

I know that

.some_class ~ video {}

doesn't work, because the video element comes before the class. Neither does

video ~ .some_class {}

because only the element with the class is styled and not the video.

So how do I go about styling the video based on the class?

0 Answers0