Skip to content Skip to sidebar Skip to footer

CSS Selector For Next And Previous Elements

How do I target the list element individually, for example I would like to make: Html:
  • Solution 1:

    Every next sibling can be represented with a + .roundabout-moveable-item, however there is no equivalent for previous siblings.

    As you need to style the next and previous elements relative to the element being designated as .roundabout-in-focus, you will not be able to do this using other techniques such as :not(.roundabout-in-focus). Therefore you can't do this using pure CSS.

    If you're using jQuery, which I'm assuming based on the .prev() and .next() notations in your example, this should be relatively easy to accomplish.


Post a Comment for "CSS Selector For Next And Previous Elements"