본문 바로가기
Edu/10.Language: HTML_N_CSS

[CSS] 그룹 선택자, 보조 박스 선택

by Lacuna028 2021. 12. 27.

HTML

<div class="box border-box">box1</div>
<div class="box bg-box">box2</div>

 

 

 

CSS

.box{
	font-size: 20px;
    &.border-box {
    	border: 10px solid red;
    }
    &.bg-box {
    	background-color: blue;
    }
}

 또는

.box.border-box {
	border: 10px solid #000;
}

.box.bg-box {
	background-color: blue;
}