How many types of css3 gradients are there?

青灯夜游
Release: 2022-03-17 18:09:02
Original
2620 people have browsed it

There are two types of css3 gradients: 1. The linear gradient created by the linear-gradient() function, which changes the color along an axis and performs a sequential gradient from the starting point to the end color; 2. The radial-gradient() function Create a radial gradient that makes a circular gradient from the start point to the end point color from the inside out.

How many types of css3 gradients are there?

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Two gradient methods:

  • #Linear Gradients: Change the color along an axis, from the starting point to the end color Sequential gradient.

background:linear-gradient(direction,color-stop1,color-stop2,……);
Copy after login
  • Radial Gradient: From the starting point to the end point, the color performs a circular gradient from the inside to the outside.

background:radial-gradient(center,shape size,start-color,……,last-color);
Copy after login

Sample code:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <style>
        #grad1
        {
            width: 200px;
            height: 200px;
            /*background-image: linear-gradient( #b7ffb5, #a880ff);*/
            /*background-image: linear-gradient(to right, #b7ffb5, #a880ff);*/
            /*background-image: linear-gradient(to bottom right, #b7ffb5, #a880ff);*/
            background-image: radial-gradient(#7af0ff, #892aff);
        }
    </style>
</head>
<body>
    <div id="grad1"></div>
</body>
</html>
Copy after login

Effect picture:

1. Up and down linear gradient

How many types of css3 gradients are there?

2. Left and right linear gradient

How many types of css3 gradients are there?

3. Diagonal linear gradient

How many types of css3 gradients are there?

4. Radial gradient

How many types of css3 gradients are there?

(Learning video sharing: css video tutorial, web front-end)

The above is the detailed content of How many types of css3 gradients are there?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!