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

What is the use of the CSS background style background property

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the CSS background style background attribute what is useful, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Css background backstage tricks

In the css organization, no matter whether it is to configure the backer tone or the scenery picture, it is usually realized by using background. Here CSS5 is popular and simple for everyone to control the background pattern of css background through graphic tutorials.

Grammar and structure

1. Grammar:

Background: background-color | | background-image | | background-repeat | | background-attachment | | background-position

2. Background parameters are indicated as follows:

The background property is a compound property. It is popular to say that the post-value of background is generally set to multi-value, such as setting the color of equipment, backing pictures, tiling pictures and other specific backing details.

Second, background attribute split

1. Backing color alone

Background-color:#000

Set the background tone to black.

But the shorthand for guarantee is:

Background:#000

Get rid of-color in background-color, similar to thrifty code

2. Backing picture

Background-image:url (backup image address); background-repeat:no-repeat;background-position:10px 20px

Configure the background image (with the introduction of the picture as the backing), the picture is not tiled (background-repeat:no-repeat;) again and again, after the picture is used as the backing, the 10px on the right side of the picture interval object starts to show, and the 20px on the picture interval object appears (background-position:10px 20px).

Abbreviations for recommendation:

Background:url (where the background picture is located) no-repeat 10px 20px

The background CSS value can be separated by a space, and the waste code can achieve the same result at the same time. Check the path self-attribute configuration and the abbreviation background to see if the CSS code can be saved.

Thank you for reading this article carefully. I hope the article "what is the use of CSS background style background properties" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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