Hexadecimal color value pairs
The default hexadecimal color value is uppercase and six-digit. Lower rendering efficiency without taking risks in unknown situations.
- Disapproval-
color:#f3a;
- Recommended-
color:#FF33AA;
|
Differences between display and visibility
Display hidden objects do not retain physical space, and visibility is the physical space occupied by hidden objects. Resources are consumed when the browser renders the occupied physical space.
- Disapproval-
visibility:hidden;
- Recommended-
display:none;
|
Difference between border: none; and border: 0;
Border: 0; although the border can be hidden, it will reserve the right to use border-color/border-style for you.
- Disapproval-
border:0;
- Recommended-
border:none;
|
The background image must not be too small.
| Although the file size is very small, a background image with a width and a height of 1 px needs to be tiled for 2500 times. |
Disagree With * {margin: 0; padding: 0;} to avoid Browser style differences
- No. wildcard * is used.
- Disagree. tags such as div span button B table include wildcards to control internal and external filling styles.
- We recommend that you use wildcards to control the internal and external fill styles.
* The wildcard number initializes all the labels, and the rendering of the browser consumes a certain amount of resources. |
Do not use the label name or class to describe the ID or class.
ID and class are unique and unnecessary.
- Difference-input # data1 {}
- Good-# data1 {}
- Difference-input. class1 {}
- Good-. class {}
|
Avoid descendant Selection Characters
- Difference-
treehead treerow treecell { }
- Better-
treehead > treerow > treecell { }
Good-.treecell-header { }
|