17.CSS color and unit of measure.

Source: Internet
Author: User

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.

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.