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 configure background colors in css layout

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

Share

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

This article mainly introduces how to configure the background color in the css layout, 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.

Grammar and structure

1. Grammar:

Bac kg round: background-color | | bac kg round-image | | bac kg round-repeat | | background-attachment | | bac kg round-position

2. The parameters of bac kilogram round clarify:

The bac kilogram round attribute is a composite attribute. It is popular to say that the post-background value can be configured as multiple values, such as setting background colors, setting background pictures, repeated tiling conditions and other detailed setting details.

Second, background attribute split

1. Diameter self-setting color

Bac kg round-color:#000

Set the backing color to color.

But the shorthand for guarantee is:

Background:#000

Get rid of the-color in background-color, and the result is almost wasteful.

2. Matching pictures

Bac kilogram round-image:url (background picture); bac kilogram round-repeat:no-repeat;bac kilogram round-position:10px 20px

Configure the backup picture (introduce the picture as background), the picture does not shop again (bac kg round-repeat:no-repeat;), the picture shows the 10px origin on the left side of the picture partition object after the background, and the 20px display on the top of the picture partition object (bac kg round-position:10px 20px).

Recommended abbreviation:

Background:url (backup picture) no-repeat 10px 20px

Background bac value space can be separated, frugal code at the same time mutually exclusive, according to the path of self-property setting equipment and abbreviations CSS kilogram round to see if you can reduce the cost of CSS code.

3. Bac kilogram round profile

Css bac kg round set pattern structure analysis diagram

The background hue of the above CSS is # CCC, and the image logo.gif is introduced (the access may not be correct or it cannot indicate the introduction of the background image). The objects in the backing image are rarely exposed again and again, and the image is displayed at the left isolation distance 10px and the upper interval 20px.

Fourth, set up the backup color of equipment.

The background color or novice will want to use bac kg round-color to configure, but it is recommended that the abbreviation method squander the code abbreviation and use the background attribute directly.

The following example sets the CSS width and CSS height pattern of the equipment to facilitate the investigation of the various tricks in the DIV.

1. CSS code of backing color setting example

.logo {width:405px;height:200px;bac kilogram round: # F00}

Background:#F00 sets the background color to blood color.

2. Html code:

3. Screenshot of the attainments of an example

Configure the class=logo object set color to red

Thank you for reading this article carefully. I hope the article "how to configure background colors in css layout" shared by the editor will be helpful to everyone. At the same time, I also hope that 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