CSS Magic: Turn any button into a ripple-effect wonder! 🎨
Abdullah Al Masud

Abdullah Al Masud @abdullah_al_masud

About: Front-End Developer | Tech Enthusiast | SEO Expert | Wordpress Developer | Content Researcher | Entrepreneur | Learner | Dreamer

Location:
Dhaka, Bangladesh
Joined:
Mar 27, 2025

CSS Magic: Turn any button into a ripple-effect wonder! 🎨

Publish Date: Apr 6
0 0

CSS Magic: Turn any button into a ripple-effect wonder! 🎨→ Uses ::after pseudo-element ✅
→ Smooth transition ✅
→ Scales from center outward ✅

        .btn {
            position: relative;
            padding: 10px 20px;
            font-size: 1.2rem;
            color: white;
            background: #ff5733;
            border: none;
            overflow: hidden;
        }
        .btn::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 500%;
            height: 500%;
            background: rgba(255,255,255,0.3);
            transition: 0.6s;
            transform: translate(-50%, -50%) scale(0);
            border-radius: 70%;
        }
        .btn:active::after {
            transform: translate(-50%, -50%) scale(1);
            opacity: 0;
        }

        /* 
        Copyright : Abdullah Al Masud
        Facebook : Ctrl + Masud
        */
Enter fullscreen mode Exit fullscreen mode

Pro tip: Adjust width/height and transition-duration for different effects.

Try it in your project!

Comments 0 total

    Add comment