Animated text underline in CSS only

PHPz
Release: 2024-07-16 18:19:31
Original
631 people have browsed it

Animated underline

.animated-underline {
    position: relative;
    text-decoration: none;
}

.animated-underline::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 100%;
    height: 0.125em;
    background-color: hsl(200deg, 100%, 50%);
    transition: transform 320ms ease;
    transform: translate(-50%, 0%) scaleX(0);
    transform-origin: right;
}

.animated-underline:hover::after {
    transform-origin: left;
    transform: translate(-50%, 0%) scaleX(1);
}
Copy after login

The above is the detailed content of Animated text underline in CSS only. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!