Symbols representing units in CSS

Source: Internet
Author: User
Tags format integer relative resource valid
Css

The value of a length consists of an optional plus "+" or minus sign "-", followed by a number, and two letters indicating the unit. There is no space in the value of a length, for example, "1.3 em" is not a valid length value, but "1.3em" is valid. A zero-length two-letter unit declaration is not required.

Both the relative value and the absolute length are supported by CSS1. A relative value unit determines the length of a property relative to another length, because it is better adapted to different media, so it is preferred. The following are valid relative units:
EM (em, the height of the element's font)
Ex (x-height, height of the letter "X")
PX (pixel, relative to screen resolution)

Absolute length units depending on the output medium, so inferior to the relative units. The following are valid absolute units:
In (inches, 1 inches = 2.54 cm)
CM (cm, 1 cm = 10 mm)
MM (m)
PT (dot, 1 o ' =1/72 inches)
PC (PA, 1 PA = 12 points)

Percent Unit

A percentage value consists of an optional plus "+" or minus sign "-", followed by a number, and a percent semicolon "%". There is no space in a percentage value.
Percent values are used to define each property in relation to other values. The most commonly used percent value is the font size relative to the element.

Color units

A color value is a keyword or a number in RGB format.

Windows VGA (video image array) forms 16 keywords: aqua,black, blue,fuchsia,gray,green, lime,maroon,navy,olive, Purple,red,silver,teal, White,and Yellow.

RGB colors can have four different forms:
#rrggbb (e.g., #00cc00)
#rgb (e.g., #0c0)
RGB (X,X,X) x is an integer ranging from 0 to 255 (for example, RGB (0,204,0))
RGB (y%,y%,y%) y is an integer ranging from 0.0 to 100.0 (for example, RGB (0%,80%,0%))
The above example specifies the same color.

Unified Resource Management URL

The format of a URL value is: URL (foo), and foo is a URL (Uniform resource management, Internet address). The URL can optionally be in single quotes (') or double quotes ("), and can contain spaces before or after the URL.

Brackets, commas, spaces, single quotes, or double quotes in the URL must be avoided by backslashes. Incomplete URLs are understood as the source code of the stylesheet, not the HTML source code.



Related Article

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.