Select all elemens between two class names
Do you want to select all the elements between two different class names? Use the :not() selector to do it
.start ~ :not(.end,.end ~ *) {
}
See the Pen Select elements between two classes by Temani Afif (@t_afif) on CodePen.
More CSS Tips
- A Ribbon title to the edge of the screen A magic border-image trick to add a ribbon shape to your title that extends to the endge of the screen.
- Full screen slanted background Only 2 properties to create a slanted background that extends to the edge of the screen.
- A reveal hover effect with a single element Add a reveal animation to your image with a minimal code.
- A fancy hover effect with rotating squares Transform your image into little rotating squares with a fancy hover effect.