Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How CSS transition work with linear gradient background button?

  • Last Updated : 22 May, 2020

In CSS, you can smoothly make transitions between two or more colors. CSS has two types of gradients:

  • Linear gradient: It goes down/up/left/right/diagonally and makes smooth transitions of colors. To make a linear transition you first have to choose two color stops. Color stops are the color among which you want to make the transitions. You can also select a starting point and a direction(an angle) for the transition.
    background-image: linear-gradient(direction, color-stop1, color-stop2, …);
  • Radial gradient: It is defined by the center. Here also you have to specify at least two color spots.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

background-image: radial-gradient(shape size at position, 
start-color, ...);


<!DOCTYPE html>
            Transition work with linear gradient
            background button
            button {
                linear-gradient(to bottom right, green, white);
            button:hover {
                linear-gradient(to bottom right, green, yellow);
            h1 {
                color: green;
            <b>Hover over the bytton</b>
            <button>Click me</button>


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!