DEV Community

Discussion on: Reasons not to use IDs in CSS

Collapse
 
scottishross profile image
Ross Henderson

Great post!

In the course I'm doing for full-stack development, in the CSS section it was advised to never use IDs ever, unless you absolutely need to. IDs are better used for JS it was suggested, and if anything it's lazy and inefficent code.

I wish I had known that when I learnt CSS a while ago and in my current codebase it's littered with IDs aha.

Collapse
 
clairecodes profile image
Claire Parker-Jones

That's great that you can look critically at your old code and know how you'd improve it - you're definitely improving as a dev!