Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add background pictures to CSS

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report