Home > Article > Web Front-end > Unit in CSS_html/css_WEB-ITnose
CSS presets 16 colors and derivatives of 16 colors. These 16 colors are recommended by CSS specifications and can be recognized by some mainstream browsers, as shown in the following table:
Hexadecimal color is the most common way to define it. Its basic format is #RRGGBB, where R, G, and B represent red, green, and blue respectively. You can also use RGB (R, G, B) to set the color. The parameters are represented by decimal numbers from 0 to 255
In order to ensure that the page elements can be fully displayed in the browser according to a reasonable layout, you need to set the spacing of each element. As well as the border size of the element itself, etc., these attribute values are inseparable from the use of length units.
In CSS, length units are divided into absolute units and relative units.
CSS mainly includes the following 5 absolute units:
Relative units refer to the unit values of other page elements that need to be referenced when measuring. Actual distances measured using relative units may change as the values of these units change.
CSS provides 3 relative units: