14th Chapter CSS colors and units of measure
First, color table scheme ( In addition to the color table, to get the color value, you can get the corresponding value by using Photoshop's palette of graphic design software )
Color Table lookup URLs such as:
***********************************************************************************************
* http://xh.5156edu.com/page/z1015m9220j18754.html *
* http://www.w3school.com.cn/tags/html_ref_colornname.asp// website has color name, symbol, attributes, etc. *
***********************************************************************************************
1, the hexadecimal wording
example,@charset = "Utf-8";
p{
color:red;
Color:darkgoldenrod;
Color: #ff0000; in hexadecimal, paired occurrences of numbers can be written as a
Color: #000000; like #ff0000; can be written #f00; #000000; written #000 ;
}
2, the decimal notation
function description example
rgb (r,g,b) with rgb model represents color rgb (0,128,128)
Rgba (r,g,b,a) Ibid,A for transparency between 0~1 R ABA (0,128,128,0.5)
HSL (h,s,l) uses HSL models (hue, saturation, and transparency) to represent color HSL (120,100%,30%)
Hsla (h,s,l,a) ibid.,A for transparency 0~1 H SLA (120,100%,30%,0.5)
example, p{
Color:rgb (0,128,128)
Color:rgba (0,128,128,0.5)//a , the smaller the value, the more transparent
COLOR:HSL (120,100%,30%)
}
Ii. Unit of Measure
1, Absolute's really into single bit (with less comparison)
2, relative units (often used)
(1)em relative units
example,p{
color:red;
marge:0; } Learn later
padding:0; the contents of the }
Background:gray; Gray Rectangle Background Frame
font-size:20px; Font Size
Height:2em; the relative size of the background box
}
(2)px pixels are relative units, the flexibility of no em High, but the use of low difficulty, often used;
p{
....;
height:20px;
}
(3)%% ( Percentage of the total length of the background box)
p{
....;
Background:silver;
font-size:200%;
width:50%; % of the total length
}
17.CSS color and unit of measure.