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 are the css background styles?

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

Share

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

This article mainly introduces "what are the css background styles". In the daily operation, I believe many people have doubts about the css background styles. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the questions about "what are the css background styles?" Next, please follow the editor to study!

Css background styles include: background-color, background-image, background-position, background-attachment, background-repeat, background.

The operating environment of this tutorial: windows7 system, CSS3 version, Dell G3 computer.

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

Background-color: color / transparent

Description:

Transparent is fully transparent

Color value (color name / RGB/ hexadecimal)

The background area includes content, inner margin (padding) and frame (border), and does not include outer margin (margin)

2. Background-image sets the background picture of the element.

Background-image:url (picture address) / none

Description:

The url address can be either relative or absolute

The background of the element occupies all the dimensions of the element, including the inner margin and the border, but not the outer margin

By default, the background image is located in the upper-left corner of the element and repeats horizontally and vertically.

When the background picture is set and the background color is set, the background picture will overwrite the background color.

3. Background-position sets the starting position and background location of the background image.

Background-position: percentage / px/top/right/bottom/left/center

4. Whether the background-attachment background image is fixed or scrolled with the rest of the page

Background-attachment:scroll/fixed

Scroll: default value, scrolling as the picture scrolls

Fixed: the background image does not move when the rest of the page scrolls

5. Background-repeat sets whether and how the background image is repeated.

Background-repeat:repeat/no-repeat/repeat-x/repeat-y / / are repetition, non-repetition, horizontal repetition and non-repetition respectively.

6. Background shorthand attribute, which sets the background property in a declaration.

Background: [background-color] [background-image] [background-repeat] [background-attachment] [background-position]

Description: the values are separated by spaces, regardless of order

At this point, the study of "what are the background styles of css" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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