CSS DIV background color can be designed through the background-color property of CSS itself , and not only the DIV background color can be used, but also various elements in the webpage can be used. Because background-color is the standard syntax of CSS background color design, it is the mainstream Both browsers support. Usually when background-color is used to design the background color of DIV, you will need to use the " color code table " to select different colors, and directly apply the background-color syntax parameters. The following are several design examples of CSS DIV background colors. CSS DIV background color design example
<div style="background-color:#FFD382;padding:10px;margin-bottom:5px;">design the DIV background color as #FFD382</div>
<div style="background-color:#82FF82;padding: 10px;margin-bottom:5px;">design the DIV background color as #82FF82</div>
<div style="background-color:#30FFFF;padding:10px;5"> design the DIV background color as #30FFFF< /div>
The effect of the exampleDesign the DIV background color as #FFD382
Design the DIV background color as #82FF82
Design the DIV background color as #30FFFF
The example has three DIV blocks, including three CSS properties, namely background-color , padding , and margin-bottom. The focus is on background-color, which is used to control the background color of DIV, while padding is only used to control the inner margin , Margin-bottom is the distance between DIVs , which is the so-called outer distance. Friends who are interested in these basic CSS properties can read the following grammar explanations.- CSS padding properties and usage examples
- CSS margin properties and usage examples
Let’s go back to the DIV background color. You can notice that the background-color of each DIV uses a different color code, such as #FFD382, #82FF82... These are all hexadecimal color codes, each The color code only represents one color. These color codes are the main key to control the background color of DIV. You can choose different colors from the " Color Code Table " on this site . If you want to know more about the background-color property, please read the introduction of " CSS background-color background color ". In addition, the simple background color is not enough to satisfy the exquisite style of the webpage. You can consider using a background image. Please refer to: CSS DIV background image .
Post a Comment
0 Comments