실전퍼블리싱(before, after 가상클래스 활용)

Dev_Go·2022년 7월 11일
0
post-thumbnail

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;
}
profile
프론트엔드 4년차

0개의 댓글