Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第三十八题:BEM 规范 #38

Open
Ray-56 opened this issue Oct 9, 2019 · 1 comment
Open

第三十八题:BEM 规范 #38

Ray-56 opened this issue Oct 9, 2019 · 1 comment
Labels
CSS 层叠样式表

Comments

@Ray-56
Copy link
Owner

Ray-56 commented Oct 9, 2019

BEM 规范

@Ray-56 Ray-56 added the CSS 层叠样式表 label Oct 9, 2019
@MMmaXingXing
Copy link

什么是BEM规范

BEM是一套CSS的命名规范。

规则

将CSS分出三个部分的概念

  • 块 block
  • 元素 element
  • 修饰符 modifier
  • 以上与--和__连接

命名约定格式如下

  • .block {} 此为高级别的抽象组件
  • .block__element {} 此为block的后代,用于形成一个完整的block整体
  • .block--modifier {} 此为block的不同状态或不同版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS 层叠样式表
Projects
None yet
Development

No branches or pull requests

2 participants