• 카테고리

    질문 & 답변
  • 세부 분야

    웹 개발

  • 해결 여부

    미해결

a태그 중앙정렬2

22.03.26 23:28 작성 조회수 111

1

이미 아래에 질문했었는데 며칠이 지나도 답이 오지 않아 다시 한 번 여쭤봅니다.
 
해결책으로 남겨주신 vertical-align:middle은 변화가 없었는데 잘못 추가한걸까요?
그리고 또 다른 해결책인 transform: translateY(-3px) 을 알려주셨는데 왜 -3px인지 궁금합니다
답 주시면 감사하겠습니다.
<!DOCTYPE html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <title>pseudo Example 1</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <div class="gnb">
      <a href="#none">Online Class</a>
    </div>
  </body>
</html>
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@1,300&display=swap');
@keyframes jelly{
  0% , 100% {
      transform: translateY(0);
  }
  33.3333% {
    transform: translateY(-10%);
  }
  66.6666% {
    transform: translateY(10%);
  }
}
body {
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  color: white;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}
.gnb{
}
.gnb a{
  text-decoration: none;
  color: black;
  vertical-align: middle;
}
.gnb a::before{
  display:inline-block;
  width: 25px;
  height: 25px;
  content: '06';
  color: white;
  text-align: center;
  vertical-align: middle;
  font-size: 15px;
  line-height: 25px;
  background-color: dodgerblue;
  border-radius: 50%;
  margin-right: 5px;
}
.gnb:hover a::before , .gnb:hover  a::after{
    animation: jelly .5s  linear infinite;
}
.gnb a::after{
  display:inline-block;
  content: 'updated 👀';
  padding: 0px 5px;
  margin-left: 7px;
  background-color: red;
  color: white;
  border-radius: 3px;
}

답변 1

답변을 작성해보세요.

0

제가 드린 해결책인 transform: translateY(-3px) 을 알려주셨는데 왜 -3px인지 궁금합니다라고 하셨는데... 올리신 코드는 올리신 코드에 없네요. 왜 transform: translateY(-3px) 이걸 주라고 하는지는 코드를 넣어보시면 바로 알텐데 안해보신 듯 하네요.

궁금한건 언제든 질문해도 되지만 앞으로는 본인이 할 수 있는 부분은 최선을 다해 보시고 질문해주세요.

그리고 수업내용이 아닌 내용을 질문하시면서 너무 당연하게 질문하시는데... 다른 분들은 수업내용이 아닌 부분 질문할 때 굉장히 조심스럽게 질문합니다. 참고해주세요...

낭니님의 프로필

낭니

질문자

2022.03.27

네 ㅋㅋ 참고 잘할게요