HTML background color gradient effect achieved through CSS style

HTML background color gradient effect achieved through CSS style
Effect screenshots:

Implementation code:

Copy code
The code is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<style type="text/css">
.linear{
width:100%;
height:600px;
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=##15A216,endColorStr=#fafafa); /*IE*/
background:-moz-linear-gradient(top,#15A216,#fafafa);/*Firefox*/
background:-webkit-gradient(linear, 0% 0%, 0% 100%,from(#15A216), to(#fafafa));/*Google*/
background-image: -webkit-gradient(linear,left bottom,left top,color-start(0, #15A216),color-stop(1, #fafafa));/* Safari & Chrome*/
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#15A216', endColorstr='#fafafa'); /*IE6 & IE7*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#15A216', endColorstr='#fafafa')"; /* IE8 */
}
</style>
</head>
<body>
<div class="linear"></div>
</body>
</html>

<<:  Determine the direction of mouse entry based on CSS

>>:  Common CSS Errors and Solutions

Recommend

CSS and HTML and front-end technology layer diagram

The relationship between Javascript and DOM is ve...

Complete steps to enable gzip compression in nginx

Table of contents Preface 1. Configure gzip compr...

How to add shortcut commands in Xshell

As a useful terminal emulator, Xshell is often us...

Example of how to implement value transfer between WeChat mini program pages

Passing values ​​between mini program pages Good ...

Docker-compose tutorial installation and quick start

Table of contents 1. Introduction to Compose 2. C...

Solve the problem of Tomcat10 Catalina log garbled characters

Running environment, Idea2020 version, Tomcat10, ...

In-depth understanding of javascript prototype and prototype chain

Table of contents 1. What is a prototype? 2. Prot...

Don’t bother with JavaScript if you can do it with CSS

Preface Any application that can be written in Ja...

Example code of setting label style using CSS selector

CSS Selectors Setting style on the html tag can s...

Talking about the practical application of html mailto (email)

As we all know, mailto is a very practical HTML ta...

Detailed explanation of styles in uni-app

Table of contents Styles in uni-app Summarize Sty...

Display special symbols in HTML (with special character correspondence table)

Problem Reproduction When using HTML for editing,...

MySQL 5.7.12 installation and configuration tutorial under Mac OS 10.11

How to install and configure MySQL on Mac OS 10.1...