before, after 가상클래스 활용한 실전
예제보기
HTML
<div class="gnb">
<a href="javascript:viod(0)">CodingWorks Online Class</a>
</div>
CSS
body {
font-family: 'Raleway', 'sans-serif';
color: #222;
line-height: 1.5em;
margin: 0;
font-weight: 300;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
a {
color: #222;
text-decoration: none;
}
.gnb a::before {
content: '01';
background-color: royalblue;
color: #fff;
width: 20px;
height: 20px;
display: inline-block;
text-align: center;
line-height: 20px;
margin-right: 5px;
border-radius: 50%;
font-size: 12px;
}
.gnb a::after {
content: 'update';
font-size: 12px;
background-color: crimson;
color: #fff;
margin-left: 5px;
padding: 2px;
border-radius: 3px;
}