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

I need help understanding how to apply gradient coloring to a button using CSS

This is the button.

This is the button I need to create, but I have no idea how to apply multiple colors and shading effects to it. The colors used in making this button are as follows:

  • Lime Green: hsl(136, 65%, 51%)
  • Bright Cyan: hsl(192, 70%, 51%)

P.S. Could you also provide guidance on how to add a hover effect to this button?

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

>Solution :

Try this.

        .rounded-button {
            width: 150px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            font-weight: bold;
            color: #fff;
            background: linear-gradient(90deg, hsl(136, 65%, 51%), hsl(192, 70%, 51%));
            border: none;
            border-radius: 50px; /* Adjust the border-radius for the degree of roundness you want */
            cursor: pointer;
        }

        .rounded-button:hover {
            background: linear-gradient(90deg, hsl(192, 70%, 51%), hsl(136, 65%, 51%));
        }
<button class="rounded-button">Request Invite</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