search
HomeCommon Problemcss background code collection

css background code collection

Nov 01, 2023 am 10:21 AM
css background code

css background code: 1. Background color, background-color: color-name;; 2. Background image, background-image: url('image-url');; 3. Background repetition, background- repeat: repeat-style;; 4. Background position, background-position: position-style; and so on.

css background code collection

CSS background code is as follows:

1. Background color:

background-color : color-name;

Where, color-name can be any valid CSS color name or hexadecimal color value.

2. Background image:

background-image: url('image-url');

Among them, image-url is the image URL address.

3. Background repeat:

background-repeat: repeat-style;

where repeat-style can be repeat, repeat-x or repeat-y, indicates whether the background image needs to be tiled or tiled in a specific direction.

4. Background position:

background-position: position-style;

Among them, position-style can be left, center or right, Indicates the position of the background image on the page.

5. Background size:

background-size: size-style;

Among them, size-style can be auto, cover or contain, Indicates the size of the background image.

6. Background attachment:

background-attachment: scroll-style;

where, scroll-style can be scroll, fixed or local-origin, indicates whether the background image scrolls with the page, is fixed above the page, or scrolls with the page.

7. Background color and image:

background: color-name url('image-url');

You can combine the background color and Set the background image together.

8. Background gradient:

background-image: linear-gradient(direction, color-stop1, color-stop2, ...);

Where, direction is the gradient direction, which can be to bottom, to top, to left, to right or round. color-stop It is the gradient color, there can be multiple, separated by commas.

The above is a complete collection of CSS background codes, which can be combined and used as needed.

The above is the detailed content of css background code collection. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools