Linear Gradient function is introduced in CSS3 which helps to transform from one color to another seamlessly which would have been a herculean task to achieve, with linear-gradient() function you can achieve something like this.
linear-gradient(direction, color1, color2, ...); The code for the above-shown image is as follows.
<html>
<head>
<style>
body {
display: flex;
flex-direction: row;
background: wheat;
width: 100%;
height: 100%;
margin: 0;
}
.div1 {
width: 50%;
height: 100%;
background: wheat;
color: white;
}
.div2 {
width: 50%;
height: 100%;
background: linear-gradient(45deg, yellow, red, transparent);
color: white;
}
</style>
</head>
<body>
<div class="div1">
</div>
<div class="div2">
</div>
</body>
</html> In the above example div1 class has a plain background where div2 class uses linear-gradient() with which we were able to achieve the transformation.
Here is complete video explaining linear-gradient() function and repeating-linear-gradient() which will see in an another post.
If you i’m using CSS Flexbox to achieve the side by side window view, if you want to see how you can achieve here is the tutorial for it Flexbox Basics .
HackerHeap is back: a multi-platform resource for working developers building with AI coding agents. We…
// SOLVING THIS WITH AN AI ASSISTANT (2026)If you are working through this problem with…
// BUILDING THIS WITH AN AI AGENT (2026)Whether you are using Claude Code, Cursor, Windsurf,…
// SOLVING THIS WITH AN AI ASSISTANT (2026)If you are working through this problem with…
// SOLVING THIS WITH AN AI ASSISTANT (2026)If you are working through this problem with…
// SOLVING THIS WITH AN AI ASSISTANT (2026)If you are working through this problem with…
This website uses cookies.