% - Defines a measurement as a percentage relative to another value, typically an enclosing element.
p {font-size: 16pt; line-height: 125%;}
cm − Defines a measurement in centimeters.
div {margin-bottom: 2cm;}
em − A relative measurement for the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each "em" unit would be 12pt; thus, 2em would be 24pt.
p {letter-spacing: 7em;}
ex − This value defines a measurement relative to a font's x-height. The x-height is determined by the height of the font's lowercase letter.
p {font-size: 24pt; line-height: 3ex;}
in − Defines a measurement in inches.
p {word-spacing: .15in;}
mm − Defines a measurement in millimeters.
p {word-spacing: 15mm;}
pc − Defines a measurement in picas. A pica is equivalent to 12 points; thus, there are 6 picas per inch.
p {font-size: 20pc;}
pt − Defines a measurement in points. A point is defined as 1/72nd of an inch.
body {font-size: 18pt;}
px − Defines a measurement in screen pixels.
p {padding: 25px;}
vh − 1% of viewport height.
h2 { font-size: 3.0vh; }
vw − 1% of viewport width.
h1 { font-size: 5.9vw; }
vmin 1vw or 1vh, whichever is smaller.
p { font-size: 2vmin;}
You can specify your color values in various formats. Following table lists all the possible formats −
Format | Syntax | Example |
---|---|---|
Hex Code | #RRGGBB | p{color:#FF0000;} |
Short Hex Code | #RGB | p{color:#6A7;} |
RGB % | rgb(rrr%,ggg%,bbb%) | p{color:rgb(50%,50%,50%);} |
RGB Absolute | rgb(rrr,ggg,bbb) | p{color:rgb(0,0,255);} |
keyword | aqua, black, etc. | p{color:teal;} |
No comments:
Post a Comment