R
18

Found out my CSS code was slower because of one tiny mistake

I was messing around with a beginner project last night and noticed my page took 3 seconds to load. Turns out I was using too many ID selectors instead of classes, which I read slows things down on a blog post from CSS Tricks. Has anyone else found a simple coding habit that was secretly making their projects run worse?
2 comments

Log in to join the discussion

Log In
2 Comments
walker.robert
Slow" and "ID selectors" in the same sentence, guess CSS finally found a way to punish overachievers lol.
8
nora184
nora1848d ago
Lean into it and watch how fast your specificity score tanks when you put class-based hover effects on those IDs haha.
2