
텍스트 칼라가 나타나는 애니메이션을 구현해 보았습니다.
HTML 코드:
<a title="왼쪽에서 오른쪽으로">왼쪽에서 오른쪽으로</a>
CSS 코드:
a { font-family: Impact; font-size: 50px; display: inline-block; position: relative; color: white; -webkit-text-stroke: 1px #000; text-shadow: 2px 2px 1px black; } a:before { content: attr(title); display: block; position: absolute; width: 0px; white-space: nowrap; overflow: hidden; color: red; } a:hover:before { transition: all 1s linear; width: 100%; }
참고
https://www.demo2s.com/html-css/css-animate-to-change-text-color-from-left-to-right.html
https://css-tricks.com/4-ways-to-animate-the-color-of-a-text-link-on-hover/
댓글