CSS&SCSS

CSS&SCSS

BEM 방식 (Block Element Modifier)

BEM(Block Element Modifier) 네이밍 규칙 클래스에 구체적인 요소의 이름을 설정하여 누구든 쉽게 어느 위치의 요소인지 파악이 가능하다. HTML 클래스 속성의 작명법 요소__일부분 Underscore(Lodash) 기호로 요소(Element)의 일부분을 표시 요소--상태 Hyphen(Dash) 기호로 요소(Element)의 상태을 표시 사용 예시 부모 블록의 클래스명을 사용하지 않고, 요소 자체적으로 사용 /*Bad*/ .container .container__name { background-color: red; } div.container__name { background-color: red; } /*Good*/ .container__name { background-color: re..

우주방랑자 개자이너 박모나
'CSS&SCSS' 카테고리의 글 목록