Select a range of content WITHOUT JavaScript

#css #shorts

Come hang out with other dev’s in my Discord Community

Keep up to date with everything I’m up to

Come hang out with me live every Monday on Twitch!

Help support my channel
👨‍🎓 Get a course:
👕 Buy a shirt:
💖 Support me on Patreon:

My editor: VS Code –

I’m on some other places on the internet too!

If you’d like a behind the scenes and previews of what’s coming up on my YouTube channel, make sure to follow me on Instagram and Twitter.


And whatever you do, don’t forget to keep on making your corner of the internet just a little bit more awesome!

44 thoughts on “Select a range of content WITHOUT JavaScript”
  1. Neat trick! But maybe I'm just clueless, which is very likely, but I don't understand the pratical use case for this.
    If you want to target specific elements, surely there's some sort of dynamic render going on, in which case you do need JS, in the event of something changing and needing update.
    If that's not the case, wouldn't giving the elements a different class would be faster, more readable to less experienced devs and other people on your team, and ultimately achieve the same goal?

  2. This is really helpful for those of us interested in minimalist web design with no JavaScript. I scoffed at all the CSS tricks when I first started learning web development but now that I see how bloated most web pages are I'm glad your channel exists.

  3. Hey Kevin, this is an awesome tip 👍 😀 I have a similar issue. Maybe there is a solution for that too?
    I have a list where I want to select the 'li's from first to the one that has a specific class (e.g. .active). Basically, instead of from 1st to 5th element, I want from 1st to ''-element. It could be the third one or the 5th one. Is this also possible with css?
    Thanks for your great videos 😍

  4. Just got a 500 page book about TypeScript and I know pretty much everything it's trying to explain already but this is here is what kids call a big brain moment…
    …or in my words – forbidden magic.

Leave a Reply

Your email address will not be published.