CSS container background 10 color gradient Demo (linear-gradient())

CSS container background 10 color gradient Demo (linear-gradient())

grammar

background: linear-gradient(direction,color-stop1,color-stop2,...);
  • direction : Specifies the direction (or angle) of the gradient using an angle value.
  • color-stop1,color-stop2,... : used to specify the start and end colors of the gradient.

NOTE: At least two colors are required.

The first one

background: linear-gradient(to left,#d3959b,#bfe6ba);

to left sets the gradient from right to left , which is equivalent to 270deg .

insert image description here

The second

background: linear-gradient(to right,#d3959b,#bfe6ba);

to right sets the gradient from left to right , equivalent to 90deg .

insert image description here

The third

background: linear-gradient(to top,#d3959b,#bfe6ba);

to top sets the gradient from bottom to top , equivalent to 0deg .

insert image description here

The fourth

background: linear-gradient(to bottom,#d3959b,#bfe6ba); 

insert image description here

The fifth

background: linear-gradient(to top right,#d3959b,#bfe6ba);

to right top to right top = to top right , diagonal angle

insert image description here

The Sixth

background: linear-gradient(45deg,#d3959b,#bfe6ba);

There is a slight difference between " to top right and "to top right" (there is no difference when the background is a square).

insert image description here

The seventh

background: linear-gradient(45deg,#d3959b 20%,#bfe6ba);

Specifies the starting color position in percentage. The default value is 0% .

insert image description here

The eighth

background: linear-gradient(to right,#feac5e,#c779d0,#4bc0c8); 

insert image description here
insert image description here

Ninth

background: linear-gradient(45deg,#feac5e,#c779d0,#4bc0c8); 

insert image description here

The tenth

background: linear-gradient(45deg,rgba(254,172,94,0.5),rgba(199,121,208,0.5),rgba(75,192,200,0.5)); 

insert image description here

rgba uses an opacity of 0.5 .

insert image description here

This is the end of this article about CSS container background 10 color gradient Demo (linear-gradient()). For more related CSS container background color gradient content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  MySQL isolation level detailed explanation and examples

>>:  Share 8 CSS tools to improve web design

Recommend

Understand all aspects of HTTP Headers with pictures and text

What are HTTP Headers HTTP is an abbreviation of ...

The perfect solution for forgetting the password in mysql8.0.19

Recommended reading: MySQL 8.0.19 supports accoun...

Summary of 4 methods of div+css layout to achieve 2-end alignment of css

The div+css layout to achieve 2-end alignment is ...

How to convert extra text into ellipsis in HTML

If you want to display extra text as ellipsis in ...

Common problems in implementing the progress bar function of vue Nprogress

NProgress is the progress bar that appears at the...

ReactJs Basics Tutorial - Essential Edition

Table of contents 1. Introduction to ReactJS 2. U...

How to install ElasticSearch on Docker in one article

Table of contents Preface 1. Install Docker 2. In...

How to recover deleted MySQL 8.0.17 root account and password under Windows

I finished learning SQL by myself not long ago, a...

MySQL cursor functions and usage

Table of contents definition The role of the curs...

Implementation of pushing Docker images to Docker Hub

After the image is built successfully, it can be ...

How to batch generate MySQL non-duplicate mobile phone number table example code

Preface In many MySQL test scenarios, some test d...

Write a formal blog using XHTML CSS

The full name of Blog should be Web log, which me...

Docker uses Supervisor to manage process operations

A Docker container starts a single process when i...

Why Use DOCTYPE HTML

You know that without it, the browser will use qui...