Skip to main content
CSS Tip

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