Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the background attribute in CSS

Shulou Source: shulou.com Published: 2022-06-03 10:13:59 11月15日 Update

CSS background attribute how to use, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

1. Background-color sets the background color of the element.

The value of the property is a color value or keyword.

/ * Color value * / background-color: red;/* special value * / background-color: transparent; transparency, default value

2. The background-image attribute is used to set one or more background images for an element.

> syntax: background-image:url (picture path) | none >.. / indicates the previous section directory. / indicates the current directory none: does not show the background image

3. Background-repeat defines the repetition of the background image.

The background image can be along the horizontal axis and the vertical axis.

`repeat`: tile horizontally and vertically. `repeat`: if it is not tiled, the background image will only be displayed once. `space`: tile `repeat-y` horizontally only: tile `space` only vertically: automatically zoom until the entire container is filled. The image will be repeated as much as possible, but will not be cropped. Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Background image attribute direction horizontal element picture way color help clear special two keyword content multiple container as much as possible Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Linux Huawei Redmi vpn