Home  >  Article  >  Web Front-end  >  Introduction to commonly used css background properties

Introduction to commonly used css background properties

王林
王林Original
2020-05-26 17:24:042971browse

Introduction to commonly used css background properties

1. background-color

This attribute defines the background color of the element.

The background color of the page is used in the body selector, as follows:

Introduction to commonly used css background properties

Rendering:

Introduction to commonly used css background properties

In CSS, color values ​​are usually defined in the following way:

1, Hexadecimal - such as: "#ff0000"

2, RGB - such as: "rgb(255 ,0,0)"

3. Color name - such as: "red"

(Video tutorial recommendation: css video tutorial)

2. background-image

This attribute describes the background image of the element.

By default, the background-image property will tile the page horizontally or vertically.

Example:

Introduction to commonly used css background properties

Result:

Introduction to commonly used css background properties

##3. background-repeat

If we don’t want the image to be tiled, we can use the background-repeat attribute.

Example:

Attribute introduction:

repeat-x: horizontal tiling

no-repeat:no tiling

Introduction to commonly used css background properties

Result:

Introduction to commonly used css background properties

If you want to know more related knowledge, please visit the

CSS Basics Introduction column on the php Chinese website.

The above is the detailed content of Introduction to commonly used css background properties. 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