분류
css
텍스트 위에 마우스를 올리면 애니메이션 밑줄 효과
본문
HTML :
<p class="hover-underline-animation">마우스를 올리면 텍스트에 밑줄이 그려집니다.</p>
CSS :
.hover-underline-animation {
display: inline-block;
position: relative;
color: #0087ca;
}
.hover-underline-animation::after {
content: '';
position: absolute;
width: 100%;
transform: scaleX(0);
height: 2px;
bottom: 0;
left: 0;
background-color: #0087ca;
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}
.hover-underline-animation:hover::after {
transform: scaleX(1);
transform-origin: bottom left;
}
- 이전글순수 CSS로 원 모양을 만들기 18.06.14
- 다음글높이를 알 수 없는 경우 요소 높이를 0에서 auto로 전환 18.06.14