3# CSS 인터뷰 주제
BEM CSS
Block
Element
Modifier
BEM CSS란 무엇입니까?
BEM stands for Block, Element, and Modifier. It’s a CSS naming methodology to reduce the CSS footprint and maintain large CSS codebases.
/* Block component */
.btn {}
/* Element that depends upon the block */
.btn__price {}
/* Modifier that changes the style of the block */
.btn--orange {}
.btn--big {}
차단하다
A block holds every element inside and acts as a scope. Think of it as bigger structural chunks of your code.
<div class="card">
<img src="...">
<h2>...</h2>
<p>...</p>
<a>...</a>
</div>
요소
An element is a component within the block that performs a particular function. It should only make sense in the context of its block.
<div class="card">
<img class="card__img" src="...">
<h2 class="card__title" >...</h2>
<p class="card__description" >...</p>
<a class="card__button">...</a>
</div>
수식어
A modifier adds additional styles to a specific element(s).
<div class="card card--dark">
<img src="...">
<h2 class="card__title card__title--large">...</h2>
<p>...</p>
<a>...</a>
</div>
Reference
이 문제에 관하여(3# CSS 인터뷰 주제), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/vasconevesxd/3-css-interview-topics-282m텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)