DEV Community

pritudev
pritudev

Posted on

Change background on scroll only css

Create a linear gradient background color that starts from the top. It starts from teal/green to blue:

Example

body {
  height: 3000px; /* Used to enable scrolling */
  background: linear-gradient(55deg, #0fb8ad 0%, #1fc8db 51%, #2cb5e8 85%);
}
Enter fullscreen mode Exit fullscreen mode

Discussion (0)