Create a div element with a width and height of 500px. create a diagonal linear gradient using the colors of the rainbow- red orange yellow green blue indigo violet. Then in seperate program create a radial gradient with 3 colors, the width and height are 500px and the graident starts at the bottom-left corner.
HTML
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Here a new web page with name "linearGradient.html" is created, which contains following code.
linearGradient.html :
<!DOCTYPE html>
<html lang="en">
<head>
<!-- title for web page -->
<title>Linear Gradient</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- internal stylesheet -->
<style>
/* style rule for div */
div{
height: 500px;
width: 500px;
background:linear-gradient(to bottom right ,red,orange, yellow, green, blue, indigo, violet);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
======================================================
Output : Open web page linearGradient.html in the browser to get the screen as shown below
Screen 1 :linearGradient.html
********************************************
Question 2:
Here a new web page with name "radialGradient.html" is created, which contains following code.
radialGradient.html :
<!DOCTYPE html>
<html lang="en">
<head>
<!-- title for web page -->
<title>Radial Gradient</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- internal stylesheet -->
<style>
/* style rule for div */
div{
height: 500px;
width: 500px;
background-image: radial-gradient(circle at bottom left,maroon,pink,purple);
}
</style>
</head>
<body>
<div></div>
</body>
</html>
======================================================
Output : Open web page radialGradient.html in the browser and will get the screen as shown below
Screen 1 :radialGradient.html
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
Get Answers For Free
Most questions answered within 1 hours.