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 .
Question : Given an array of integers A, return the largest integer that only occurs once.…
Jump search algorithm is a pretty new algorithm to search for an element in a…
What is Knuth Morris Pratt or KMP algorithm ? KMP is an algorithm which is…
Binary Search is a Logarithmic search which finds the target element in a sorted array…
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X…
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such…
This website uses cookies.