Example Analysis of body Selector in css
This article mainly shows you the "sample analysis of body selector in css", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and study the "sample analysis of body selector in css".
Body {color: blue}
The purpose of the above line of code is to define the text color within the body element as blue. In the above example, the body is the selector, and the part enclosed in the curly braces is the declaration. The declaration consists of two parts: the attribute and the value, with color as the attribute and blue as the value.
Different writing methods and units of values
In addition to the English word red, we can also use the hexadecimal color value # ff0000:
P {color: # ff0000;}
To save bytes, we can use the abbreviation of CSS:
P {color: # f00;}
We can also use RGB values in two ways:
P {color: rgb (255j0pm 0);}
P {color: rgb (100% Percoll 0% 0%);}
Note that when using RGB percentages, the percentage symbol is written even when the value is 0. But in other cases you don't need to do this. For example, when the size is 0 pixels, you don't need to use px units after 0, because 0 is 0, no matter what the unit is.
Remember to write quotation marks
The above is all the content of the article "sample Analysis of body selectors in css". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!