When we use CSS styles, we must understand its rules, otherwise some styles will not be displayed when we execute the HTML file. It has certain reference value and I hope it can be helpful to everyone.
In css, the English ":
" needs to be used to connect an attribute to its attribute, and the English ":
" needs to be used between multiple attributes.
" to connect for easy differentiation.
Features:In css, various selectors are strictly case-sensitive, but attributes and their values are not case-sensitive and can be mixed, but according to our Writing habits, these are all written in lowercase;
When writing css code, you need to use curly braces to enclose the code;
Every attribute is written in English." ;" to separate, the semicolon after the last attribute value can be omitted;
There are many words and many spaces between the attribute values, so this css code must be added in full English quotation marks, otherwise this command will be invalid;
When writing css code, in order to improve the readability of the code, we need to add css comments to facilitate our next reading;
In css , the space bar and other things we hit when writing code will not be parsed, so the spaces before and after the curly braces and semicolons can be omitted, but for the sake of appearance, we need to use the space bar; when writing When writing CSS code, we will use the space bar,
, and the Enter key to layout the code, which makes it easier for us to observe and improve the beauty and readability of the code. Recommended learning:
CSS3 video tutorial######The above is the detailed content of The CSS rules you don't know are worth collecting! !. For more information, please follow other related articles on the PHP Chinese website!