Skip to content

Comment on Don’t use IDs in CSS selectors? (2011)parent

Comments

Totally agree, but in this case I can say for sure that the benefits of using IDs are so impractical, that with no doubt I will add a class name to the target element style the class not the ID.

In my development practice I've found that messing CSS with IDs don't help scale your app ( you can hardly override them ), they are also subject of all the reasons stated here and in the article ( bad performance, global scope introduction, ... ).

The only reason to style IDs would be if I happen to have an old theme that people styling it were using IDs.

I totally don't support styling IDs ( or using !important - which basically is on the same page ).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.