Unit list in CSS, including width, size, unit color, unit angle, unit frequency, Unit

Source: Internet
Author: User

Relative Length unit: relative length units

Em
Description: Unit of relative length. The font size relative to the text in the current object.
If the font size of the text in the current row is not set manually, the default font size is relative to that of the browser.
Example:
Div {font-size: 1.2em ;}

Ex
Description: Unit of relative length. The height relative to the character "X. This height is usually half the font size.
If the font size of the text in the row is not set manually, the default font size is relative to that of the browser.
Example:
Div {font-size: 1.2ex ;}

Px
Description: Unit of relative length. Pixel (pixel ).
Pixels are relative to the display screen resolution. For example, wondows users generally use a 96-pixel/inch resolution. Mac users generally use 72 pixels/inch resolution.
Example:
Div {font-size: 12px ;}

 

 

Absolute length unit: absolute length units

PT
Note:
Absolute length unit. Point ).
1In = 2.54 = 25.4 = 72pt = 6 PC
Example:
Div {font-size: 9pt ;}

PC
Note:
Absolute length unit. Pica ). It is equivalent to the size of China's new 4.
1In = 2.54 = 25.4 = 72pt = 6 PC
Example:
Div {font-size: 0.75 PC ;}

In
Note:
Absolute length unit. Inch (inch ).
1In = 2.54 = 25.4 = 72pt = 6 PC
Example:
Div {font-size: 0.13in ;}

Cm
Note:
Absolute length unit. Centimeter (centimeter ).
1In = 2.54 = 25.4 = 72pt = 6 PC
Example:
Div {font-size: 0.33 ;}

Mm
Note:
Absolute length unit. Mm (millimeter ).
1In = 2.54 = 25.4 = 72pt = 6 PC
Example:
Div {font-size: 3.3mm ;}

 

Color unit color units reference

 

# Rrggbb
Parameters:
Rr: Red value. Hexadecimal positive integer
GG: green value. Hexadecimal positive integer
BB: blue value. Hexadecimal positive integer

Note:
Color unit.
The preceding three parameters can be set to 00-ff.
The parameter must be two digits. If there is only one digit, the first zero should be added.
If the numbers of each parameter are the same on both sides, the Unit can also be abbreviated as # RGB. For example, # ff8800 can be abbreviated as # f80.
See Appendix: color table.
Example:
Div {color: # ff0000 ;}
Div {color: # f00 ;}

RGB (R, G, B)
Parameters:
R: Red value. Positive Integer | percentage
G: green value. Positive Integer | percentage
B: Blue. Positive Integer | percentage

Note:
Color unit.
The value range of the preceding three parameters is 0-255. The value range of the percentage value is 0.0%-100.0%. A value out of the range will be used as of its nearest value limit.
Not all browsers support percentage values.
See Appendix: color table.
Example:
Div {color: RGB (180 );}
Div {color: RGB (12%, 50% );}

Color name
Note:
Color unit. Color name. Different browsers have different predefined color names. See Appendix: color table.
Example:
Div {color: red ;}

 

 

Time unit time units reference

S
Note:
Time unit. Seconds. Time of the International Master Unit.
1 S = 1000 MS
Example:
Div {pause-after: 2 S ;}
Div {pause-before: 2 S ;}

MS
Note:
Time unit. Microseconds.
1 S = 1000 MS
Example:
Div {pause-after: 2 S ;}
Div {pause-before: 2 S ;}

Angle unit angle units reference

DEG
Note:
Angle unit. Degree. One of the 360 equals points of a circle.
Example:
Body {Azimuth: 75deg}
Body {elevation: 75deg}

Grad
Note:
Angle unit. Gradient. One of the 100 equals points at a right angle. A circle is equivalent to 400 grad.
Example:
Body {Azimuth: 75 grad}
Body {elevation: 75 grad}

Rad
Note:
Angle unit. Radians. Divide a circle into 2 * PI units.
Example:
Body {Azimuth: 3rad}
Body {elevation: 5rad}

Frequency Unit frequency units reference

KHz
Note:
Frequency Unit. Qianhe. The basic unit of sound waves.
1 kHz = 1000Hz
Example:
Strong {pitch: 8 kHz}

Hz
Note:
Frequency Unit. Hz. The basic unit of sound waves.
1 kHz = 1000Hz
Example:
Strong {pitch: 75Hz}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.