Sample code for using CSS to write a textured gradient background image

Sample code for using CSS to write a textured gradient background image

The page length in the project is about 2000px or more, and the background image has texture and gradient, so it will be very large and time-consuming to load, so we use CSS to implement it.

The website we mainly used this time is Hero Patterns - a free online texture library

insert image description here

This website has many ready-made backgrounds, and you can also customize the background color, pattern color and transparency.

insert image description here

The background color of the website is a solid color. If we need a gradient background, we can set the background color of the texture to a transparent color, and then set the background image of the parent element to a gradient effect.

html,body{
  background: #000;
  min-width: 1024px; 
  background-image: linear-gradient(to right, #000 -6%, #703ccc, #000 110%);
}

.Diffuse{
    min-width: 1024px;
    height: auto;
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.61' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
    }

Okay, now we are done~

insert image description here

This is the end of this article about using CSS to write sample code for textured gradient background images. For more relevant CSS texture gradient background image 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!

<<:  6 inheritance methods of JS advanced ES6

>>:  Use label tag to select the radio button by clicking the text

Blog    

Recommend

Vue uses v-model to encapsulate the entire process of el-pagination components

Use v-model to bind the paging information object...

Quickly solve the problem that the mysql57 service suddenly disappeared

one, G:\MySQL\MySQL Server 5.7\bin> mysqld --i...

How to use Nginx to realize the coexistence of multiple containers in the server

background There is a Tencent Linux cloud host, o...

A brief discussion on the implementation principle of Webpack4 plugins

Table of contents Preface know Practice makes per...

MySQL 5.7.17 installation and configuration tutorial under Linux (Ubuntu)

Preface I have installed MySQL 5.6 before. Three ...

Vue multi-page configuration details

Table of contents 1. The difference between multi...

Vue implements tab navigation bar and supports left and right sliding function

This article mainly introduces: using Vue to impl...

Analysis of the process of simply deploying nginx in Docker container

1. Deploy nginx service in container The centos:7...

Deleting two images with the same id in docker

When I created a Docker container today, I accide...

A super detailed Vue-Router step-by-step tutorial

Table of contents 1. router-view 2. router-link 3...

Steps to purchase a cloud server and install the Pagoda Panel on Alibaba Cloud

Alibaba Cloud purchases servers Purchase a cloud ...

Detailed examples of how to use the box-shadow property in CSS3

There are many attributes in CSS. Some attributes...

Explain how to analyze SQL efficiency

The Explain command is the first recommended comm...