So I have a button with initial shadow set. I want to transition the shadow on hover into another value of shadow.
button {
height:100px;
width:200px;
padding:10px;
margin:5px;
border:none;
border-radius:10px;
box-shadow: 10px 10px 20px #dde4ef, -10px -10px 20px white;
transition: box-shadow 0.5s ease-in;
}
button:hover{
box-shadow: inset 10px 10px 20px #dde4ef, inset -10px -10px 20px white;
}
<button>This Button</button>
Its not working
Prepare your inset shadows by using inset 0 0 0 transparent, inset 0 0 0 transparent,
button {
height:100px;
width:200px;
padding:10px;
margin:5px;
border:none;
border-radius:10px;
display: inline-block;
box-shadow:
inset 0 0 0 transparent, inset 0 0 0 transparent, /* Prepared inset shadows */
10px 10px 20px #dde4ef, -10px -10px 20px white; /* Outer shadows */
transition: box-shadow 0.5s ease-in;
}
button:hover{
box-shadow: inset 10px 10px 20px #dde4ef, inset -10px -10px 20px white;
}
<button type="button">HOVER ME</button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With