Home Web Front-end CSS Tutorial Four code settings for realizing web page background gradient using CSS

Four code settings for realizing web page background gradient using CSS

Jun 28, 2018 pm 02:05 PM
Gradient Web page background

This article mainly introduces the four code settings for CSS to realize web page background gradient. It has certain reference value. Now I share it with everyone. Friends in need can refer to it

1. Gradient from top to bottom

body{ 
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=#000000); 
}
Copy after login

2. Gradient from top left to bottom right

body{ 
FILTER: Alpha( style=1,opacity=25,finishOpacity=100, 
startX=50,finishX= 100,startY=50,finishY=100); 
background-color: skyblue; 
}
Copy after login

3. Gradient from left to right

body{ 
FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#ffffff,endColorStr=#000000); 
}
Copy after login

4. Gradient from top to bottom

style="filter:progid:DXImageTransform.microsoft.gradient(gradienttype=0,startColorStr=blue,endColorStr=white);"
Copy after login

For example:

 
 
 
 
背景渐变 
 
 
Copy after login

The above is the entire content of this article. I hope it will be helpful to everyone’s learning. Help, please pay attention to the PHP Chinese website for more related content!

Related recommendations:

Usage of CSS transparent opacity and IE versions of transparency filter filter

Comparison by priority Three ways to verify CSS control styles

About the use of window units and percentage units in CSS

The above is the detailed content of Four code settings for realizing web page background gradient using CSS. For more information, please follow other related articles on the PHP Chinese website!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1653
14
PHP Tutorial
1251
29
C# Tutorial
1224
24
Detailed example of how to solve the problem of CSS gradient aliasing! Detailed example of how to solve the problem of CSS gradient aliasing! Nov 25, 2022 pm 04:43 PM

This article will introduce to you how to solve the aliasing problem caused by using gradient graphics. The so-called CSS gradient aliasing disappearing technique can be done once you know it. Let's take a look at how to achieve it~ I hope it will be helpful to everyone. !

How to achieve transparency gradient effect using CSS properties How to achieve transparency gradient effect using CSS properties Nov 18, 2023 pm 05:28 PM

The method of implementing the transparency gradient effect using CSS properties requires specific code examples. In web design, the transparency gradient effect can add a soft and beautiful transition effect to the page. Through the setting of CSS properties, we can easily achieve the transition effect on transparency of different elements. Today we will introduce some common methods and specific code examples. Use the opacity attribute. The Opacity attribute can set the transparency of an element. The value ranges from 0 to 1. 0 means completely transparent and 1 means completely opaque. we can pass

How to use the PS Gradient Tool - How to use the PS Gradient Tool How to use the PS Gradient Tool - How to use the PS Gradient Tool Mar 05, 2024 pm 06:28 PM

PS software is a software that many people use in their office work, so do you know how to use the PS gradient tool? The following is the method of using the PS gradient tool brought to you by the editor. Interested users can come and take a look below. 1. Open or create a new document: First, open Photoshop software and create a new document, or open an existing image file. Select the Gradient Tool: On the left side of the toolbar, locate the Gradient Tool (between the Rectangular Marquee Tool and the Paint Bucket Tool), and click to select it. 3. Set the gradient type: In the tool options bar, you can choose different gradient types. There are linear gradient, radial gradient, angular gradient and other options to choose from. Click the Gradient Type drop-down menu and select the gradient type you want. 4

How to create gradient shadow using CSS? How to create gradient shadow using CSS? Aug 27, 2023 pm 11:41 PM

As the web continues to evolve, making a beautiful UI is one of the most important tasks to increase customer engagement on your website. One of the ways to improve the appearance of your front-end is to apply gradient shadows in CSS. The two most important methods of applying gradient shading are linear gradients and radial gradients. Gradient shadows can be used to draw user attention to specific information, apply hover or focus effects, or give a website a Web3 look and feel. In this tutorial, we'll analyze two gradient shades with practical examples. We will make use of two important CSS concepts to achieve the effect, one is the filter attribute and the other is the ::after pseudo-class. The pseudo class will be used to create a fake background, while the filter attribute will be used to apply a blur effect to the surrounding background. Method One: Linear Gradient Yin

Tips for achieving gradient border effect using CSS properties Tips for achieving gradient border effect using CSS properties Nov 18, 2023 pm 02:53 PM

The technique of realizing the gradient border effect using CSS properties requires specific code examples. In web design, the border is an important element that can bring richer visual effects to the page. And if you can achieve a gradient effect on the border, it will further increase the appeal of the page. This article will introduce some techniques for using CSS properties to achieve gradient border effects, and provide specific code examples. Use the "border-image" attribute to implement gradient borders<style>.gradient-

Golang image manipulation: how to perform gradient and texture mapping of images Golang image manipulation: how to perform gradient and texture mapping of images Aug 22, 2023 pm 12:33 PM

Golang image manipulation: How to perform gradient and texture mapping on images Overview: In image processing, gradient and texture mapping are two commonly used techniques. Gradients can create smooth transitions of color effects, while texture mapping can map a texture image to a target image. This article will introduce how to use the Golang programming language to perform gradient and texture mapping operations on images. Image gradient First, we need to import Golang's image processing packages image and image/color. The following is a sample code, created by

CSS Animation Tutorial: Teach you step by step how to implement scaling gradient effects CSS Animation Tutorial: Teach you step by step how to implement scaling gradient effects Oct 20, 2023 pm 03:49 PM

CSS Animation Tutorial: Teach you step-by-step to implement scaling and gradient effects. In modern web design, animation effects are one of the important elements that attract user attention and enhance user experience. CSS animation is an animation effect based on CSS style attributes. Dynamic effects can be achieved by changing the style attribute values ​​of elements. In this article, we will teach you step by step how to use CSS animation to achieve scaling and gradient effects, along with specific code examples. Create HTML structure First, we need to create an HTML structure to place the animations that need to be applied

How to use CSS3 properties to create web background effects? How to use CSS3 properties to create web background effects? Sep 08, 2023 pm 02:07 PM

How to use CSS3 properties to create web background effects? Background is a very important element in web design. It can improve user experience and make web pages more attractive. In CSS3, there are many new properties that can help us create a variety of web background effects. This article will introduce some commonly used CSS3 background properties, with code examples. 1. Gradient background Gradient background can add layering to the web page and make it more attractive. In CSS3 we can use linear-gradient() or rad

See all articles