Importance of background color declaration when writing styles

Importance of background color declaration when writing styles
As the title says, otherwise when the page is revised, the following situation may occur:

I am currently working on a revision project to revamp the old page, including changing the white page background to light gray. After the change, the above situation occurred. Because in the above module, the default background color transparent is used, and the background-color of the body was #FFF before, the display effect is in line with the design intention. But when the background color of the body is changed this time, the display is wrong. (The picture may not be too obvious: in the picture, except for the line of 'No record yet' and the label 'Card number', the other places are light gray. The white background is because the corresponding label displays the declared background color)

In summary, when writing styles in the future, you must explicitly declare the background of the element, including setting the background image and specifying a similar background color as a fallback. It is also best to specify the foreground color. Of course, you don't have to set it once for each element. Elements of the same style in the same module only need to be declared once on the module container.

<<:  Uniapp uses Baidu Voice to realize the function of converting recording to text

>>:  Example of how to set div background transparent

Recommend

Mysql date formatting and complex date range query

Table of contents Preface Query usage scenario ca...

Methods and techniques for designing an interesting website (picture)

Have you ever encountered a situation where we hav...

The use of vue directive v-bind and points to note

Table of contents 1. v-bind: can bind some data t...

An audio-visual Linux distribution that appeals to audiophiles

I recently stumbled upon the Audiovisual Linux Pr...

Detailed explanation of Truncate usage in MySQL

Preface: When we want to clear a table, we often ...

Four categories of CSS selectors: basic, combination, attribute, pseudo-class

What is a selector? The role of the selector is t...

The whole process of developing a Google plug-in with vue+element

Simple function: Click the plug-in icon in the up...

Summary of new usage of vi (vim) under Linux

I have used the vi editor for several years, but ...

Why the explain command may modify MySQL data

If someone asked you whether running EXPLAIN on a...

Getting Started with CSS3 Animation in 10 Minutes

Introduction Animation allows you to easily imple...

Implementation of multi-environment configuration (.env) of vue project

Table of contents What is multi-environment confi...

How to implement element floating and clear floating with CSS

Basic Introduction to Floating In the standard do...

What we have to say about CSS absolute and relative

Written in the opening: Absolute said: "Rela...

Do you know how to optimize loading web fonts?

Just as the title! The commonly used font-family l...

dl, dt, dd list label examples

The dd and dt tags are used for lists. We usually...