Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You have made some bad decisions if you find yourself 15 divs deep.

There is a surprisingly small amount of content out there on how to competently engineer your CSS (and a lot of it is bad). Most people don't even think it's something you do.

But basic things like making your general rules generic and pushing context descriptively into the HTML go a long way into making your code understandable.



> You have made some bad decisions if you find yourself 15 divs deep.

Open instagram.com in a browser :D


Or even W3C's own website


Do you mean leaning on rules like: .myWidgetClass form{ ... } .myWidgetClass form >input{ ... }


Sure, if you have some general rules that apply to all your widgets. If you are talking about something more specific, you are better with a more specific name.


Not my choice, that’s what you get when you inherit an Angular website.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: