Anjan Dutta

Create gradient colored background in CSS

Create gradient colored background in CSS

To create a gradient colored background, we have to use the gardient value with background property.

Example

Gradient background

Working code below.

The HTML

<html>
<head>
<title>Gradient colored background</title>
</head>
<body>
</body>
</html>

The CSS

body {
height: 100vh;
display: block;
background: linear-gradient(135deg, yellow,teal);
}