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

Recommend

A Guide to Optimizing High-Performance Websites

Golden Rules of Performance: Only 10% to 20% of e...

Alibaba Cloud ESC Server Docker Deployment of Single Node Mysql

1. Download the accelerated version of msyql dock...

Methods for optimizing Oracle database with large memory pages in Linux

Preface PC Server has developed to this day and h...

Advanced crawler - Use of Scrapy_splash component for JS automatic rendering

Table of contents 1. What is scrapy_splash? 2. Th...

How to set up ssh password-free login to Linux server

Every time you log in to the test server, you alw...

Teach you how to insert 1 million records into MySQL in 6 seconds

1. Idea It only took 6 seconds to insert 1,000,00...

Nested display implementation of vue router-view

Table of contents 1. Routing Configuration 2. Vue...

How to quickly add columns in MySQL 8.0

Preface: I heard a long time ago that MySQL 8.0 s...

Detailed explanation of HTML basics (Part 2)

1. List The list ul container is loaded with a fo...

Detailed process of installing Jenkins-2.249.3-1.1 with Docker

Table of contents 1. Install Docker 2. Pull the J...

Detailed explanation of scp and sftp commands under Linux

Table of contents Preface 1. scp usage 2. Use sft...

Sharing several methods to disable page caching

Today, when developing, I encountered a method wh...

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

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

A brief analysis of CSS :is() and :where() coming to browsers soon

Preview versions of Safari (Technology Preview 10...