2018-10-19 13:53:51 +01:00
---
title: Create a Gradual CSS Linear Gradient
---
2019-03-09 19:29:15 +05:30
## Create a Gradual CSS Linear Gradient
2018-10-19 13:53:51 +01:00
2019-03-09 19:29:15 +05:30
To create a linear gradient you must define *at least* two color stops. Color stops are the colors you want to render smooth transitions among. You can also set a starting point and a direction (or an angle) along with the gradient effect.
2018-10-12 15:37:13 -04:00
The syntax is always:
2019-03-09 19:29:15 +05:30
```css
background-image: linear-gradient(angle, color-stop1, color-stop2....);
2018-10-12 15:37:13 -04:00
```
The colors can be used in both hex() and rgb() formats. Experiment a bit and you'll understand how easy and beautiful it is to use it.
2019-03-09 19:29:15 +05:30
### Solution
```html
< style >
2018-10-12 15:37:13 -04:00
2019-03-09 19:29:15 +05:30
div{
border-radius: 20px;
width: 70%;
height: 400px;
margin: 50px auto;
background-image: linear-gradient(35deg, #CCFFFF , #FFCCCC );
}
2018-10-12 15:37:13 -04:00
2019-03-09 19:29:15 +05:30
< / style >
2018-10-12 15:37:13 -04:00
2019-03-09 19:29:15 +05:30
< div > < / div >
```
2018-10-12 15:37:13 -04:00
2019-03-09 19:29:15 +05:30
#### Resources
2018-10-12 15:37:13 -04:00
2019-03-09 19:29:15 +05:30
* < a href = 'https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient' > There's an extensive info on this topic available on this link.</ a >
* < a href = 'https://www.youtube.com/watch?v=wTk4Wuckd0U' > Also, you might want to review this Youtube video by The Net Ninja.</ a >