CSS Attribute Selectors @KevinPowell
CSS Attribute Selectors  @KevinPowell
Uploaded November 2025 | Updated September 2026, 2 weeks ago
Following up from last week's video, I explore some advanced attribute selector techniques that let you target elements based on how their attributes start, end, or contain specific values. Near the end, I look at some use cases, like adding icons to external links and PDFs.

šŸ”— Links
āœ… Bottom of this CodePen has the examples from this video: codepen.io/kevinpowell/pen/MQYGwY

āœ‰ Keep up to date with everything I'm up to kevinpowell.co/newsletter
šŸ’¬ Come hang out with other devs in my Discord Community discord.gg/nTYCvrK
⭐ Are you a beginner? HTML & CSS for absolute beginners is for you: learn.kevinpowell.co
šŸŽ“ Start writing CSS with confidence with CSS Demystified: [https://cssdemystified.com](https://cssdemystified.com/)
šŸš€ Already mastered CSS? Check out my advanced course, Beyond CSS: https://www.beyondcss.dev/

⌚ Timestamps
00:00 - Introduction
00:40 - Select exact matches
01:45 - Select any match
03:10 - Select prefixes
05:15 - Select based on any starting string of characters
06:35 - Select based on any ending string of characters
07:45 - A few practical use cases
09:25 - All occurances of a string
10:40 - Attribute selector performance

#css

---

Help support my channel
šŸ‘Øā€šŸŽ“ Get a course: kevinpowell.co/courses
šŸ‘• Buy a shirt: cottonbureau.com/people/kevin-powell
šŸ’– Support me on Patreon: patreon.com/kevinpowell or through YT memberships: youtube.com/@KevinPowell/join

---

šŸ§‘ā€šŸ’» My editor: VS Code - code.visualstudio.com

🌈 My theme: One Dark Pro Var Night
šŸ”¤ My font: Cascadia 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:

Bluesky: https://bsky.app/profile/kevinpowell.co
Codepen: codepen.io/kevinpowell
Github: github.com/kevin-powell

---

And whatever you do, don't forget to keep on making your corner of the internet just a little bit more awesome!
CSS Attribute SelectorsThis CSS property fixes a problem as old as CSSThis blew my mindI challenged a CSS Wizard to a CSS BattleEverybody is dead!Stop using rgba() and hsla()A simple shift to better understand CSSStart by over-engineeringStop using the legacy color syntaxTwo new lines for your CSS resetTailwind revenue down 80% because of AIUsing code elements when you should be using kbd?
Kevin Powell |

CSS Attribute Selectors

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER