- Mastering CSS
- Rich Finelli
- 134字
- 2021-07-08 09:45:54
BEM
One technique for keeping specificity low is avoiding descendant selectors altogether using BEM. BEM stands for Block Element Modifier and is a naming convention for CSS. The idea is to use a specific naming convention to add a class to every element you are eventually going to style. This way every element has a specificity score of 10, thus every element has the same specificity. There's a lot more to it that just that, and I recommend checking it out at http://getbem.com/ to learn more about it. I tend to use the BEM methodology, but that's not to say descendant selectors need to be completely avoided. I think there's a time and place for them. My suggestion is keep your descendant selectors reasonable and avoid longer descendant selectors with more than 3 levels.
- Java程序設計實戰教程
- Mastering Ember.js
- Web Scraping with Python
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優化計算
- The Complete Coding Interview Guide in Java
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- Mastering SciPy
- Python硬件編程實戰
- Python應用開發技術
- PHP+MySQL Web應用開發教程
- 用Go語言自制編譯器
- 鋁合金陽極氧化與表面處理技術(第三版)
- Python深度學習入門:從零構建CNN和RNN
- 軟件自動化測試實戰解析:基于Python3編程語言
- OpenStack Networking Cookbook