Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I put a simple transition on this button?

I’ve made this simple button with gradient, but how do I make the transition work? I tried using transition: .2s linear, but it isn’t working.

.contact_button {
    color: white;
    font-size: 20px;
    width: 130px;
    height: 50px;
    border: solid 4px transparent;
    border-radius: 80px;
    background-image: linear-gradient(black, black), linear-gradient(to right ,#00AEAD, #72CC50);
    background-origin: border-box;
    background-clip: content-box, border-box;
    cursor: pointer;
}

.contact_button:hover {
    background-image: linear-gradient(transparent, transparent), linear-gradient(to right ,#00AEAD, #72CC50);
}
<button class="contact_button">Contact</button>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Do it differently using mix-blend-mode and you can apply a transition to background-color

.contact_button {
    color: white;
    font-size: 20px;
    width: 130px;
    height: 50px;
    border: solid 4px transparent;
    border-radius: 80px;
    background: 
      linear-gradient(to right ,#00AEAD, #72CC50) border-box,
      #000 content-box;
    background-blend-mode:darken;
    cursor: pointer;
    transition:0.5s;
}

.contact_button:hover {
    background-color:#0000;
}
<button class="contact_button">Contact</button>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading