For developing front end , BEM is a perfect way of name your dom css name .
there is simple introduce :
.1 .block-warp-name :represent advance or abstract parent dom .
.2 .block--wrap-name__name : the block in block-wrap-name
.3 .block-wrap-name--modify : the different state of it self .
Notice : use __ – because “-” will be used in wrap block . and you needn’t use “BEM” anywhere but the place that need use .
Example :
< form class = "site-search full">
<input type="button" class="btn"/>
</form>
---------------------------------------------------
< form class = "site-search site-search--full">
<input type="button" class="site-search__btn"/>
</form>
it's so simple you can use anywhere .
BEM方法精讲
本文介绍了BEM(Block Element Modifier)方法的基本概念及其在前端开发中的应用。BEM是一种流行的前端命名约定,它有助于创建可维护性和可复用性强的CSS类名。文章通过实例详细解释了如何使用BEM来组织CSS类,包括块、元素和修饰符的概念。
1023

被折叠的 条评论
为什么被折叠?



