<ul class="social">
<li><a href="#none">facebook</a></li>
<li><a href="#none">twitter</a></li>
<li><a href="#none">instagram</a></li>
<li><a href="#none">youtube</a></li>
</ul>
.social {
list-style: none;
padding: 0;
margin: 0;
width: 600px;
display: flex;
li {
border: 1px solid #000;
padding: 10px;
flex: 1;
text-align: center;
a {
color: #000;
text-transform: uppercase;
}
}
}
& : 부모요소 선택자!
<div class="btn-outer">
<a class="btn" href="#none">CodingWorks Class</a>
</div>
.btn-outer {
.btn {
color: #fff;
text-transform: uppercase;
width: 300px;
display: inline-block;
text-align: center;
height: 50px;
line-height: 50px;
background-color: #555;
transition: 0.3s;
position: relative;
&:hover {
background-color: transparent;
}
&:before,
&:after {
content: '';
width: inherit;
height: inherit;
border: 1px solid #fff;
position: absolute;
top: 0;
left: 0;
opacity: 0;
transition: 0.3s;
}
&:hover:before {
opacity: 1;
transform: rotate(45deg);
}
&:hover:after {
opacity: 1;
transform: rotate(-45deg);
}
}
}
<section>
<h1 class="font-large">This is H1 Headline</h1>
<h2 class="font-medium">This is H2 Headline</h2>
<h3 class="font-small">This is H3 Headline</h3>
</section>
font-머시기
로 통일 되고있다 이럴때 부모 선택자를 이용하여 변수처럼 사용할 수 있다..font {
// .font-large {...} 로 응용
&-large {
font-size: 60px;
color: crimson;
text-transform: uppercase;
}
&-medium {
font-size: 40px;
color: yellowgreen;
text-transform: uppercase;
}
&-small {
font-size: 20px;
color: royalblue;
text-transform: uppercase;
}
}