Get the App
SLTechnology News&Howtos  ›  Development  › 

How to add background pictures to CSS

Shulou Source: shulou.com Published: 2022-06-01 13:07:55 10月04日 Update

This article mainly introduces the CSS how to add background picture related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will get something after reading this CSS how to add background picture article, let's take a look at it.

Background attribute

Before we can learn how to add background images, we need to learn the background attribute. It is specially used to set the background color or background picture.

Background-color: sets the background color.

Background-position: sets the location of the background image.

Background-size: sets the size of the background image.

Background-repeat: sets whether to repeat the background image.

Background-origin: sets the location area of the background image.

Background-clip: sets the drawing area of the background.

Background-attachment: sets whether the background image is fixed or scrolled along with the rest of the page.

Background-image: sets the path of the background image.

Background-image is needed to set the background image.

Background-image:url (Picture path)

Examples are as follows:

CSS setting background picture-(yisu.com) body {background: url (". / image/img1.png") no-repeat;} this article on "how to add background picture to CSS" ends here, thank you for reading! I believe you all have a certain understanding of "how to add background pictures to CSS". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Background picture background picture image knowledge learning content region attribute article path value location size easy to operate article easy to understand more see example Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL macOS Xiaomi NVidia Shulou Tech Info