Title Text

Quantity Queries

Example of Quantity Queries

at-least

ul li:nth-last-child(n+5),ul li:nth-last-child(n+5) ~ li {
 //styles goes here
}

at-most

ul li:nth-last-child(-n+5):first-child,ul li:nth-last-child(-n+5):first-child ~ li {
 //styles goes here
}

in-between

ul li:nth-last-child(n+5):nth-last-child(-n+10):first-child,
ul li:nth-last-child(n+5):nth-last-child(-n+10):first-child ~ li {
 //styles goes hereā€¦
}

Solution to writing Quantity Queries

Bonus with SASS

Cross Browser Compability

Happy Counting :)

Quantity Queries

By sweetanzell

Quantity Queries

allow styles to be applied to elements based on the number of siblings

  • 556