How to create fading effect with CSS


To create a fading effect with CSS, use the c You can try to run the following code for fading effect:

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         #demo {
            height: 100px;
               background: linear-gradient(to right, rgba(255,50,30,0), rgba(255,50,30,1));
            }
         </style>
      </head>
   <body>
      <h2>Linear Gradient</h2>
      <div id = "demo">Fading Effect</div><br>
   </body>
</html>

Updated on: 23-Jun-2020

221 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements