CSS Values and Units Module Level 3
http://www.w3.org/TR/2013/CR-css3-values-20130730/#viewport-relative-lengths
2.5. Property value examples
Below are some examples of properties with their corresponding value definition fields
Property | Value definition field | Example value |
---|---|---|
‘orphans ’ | <integer> | ‘3 ’ |
‘text-align ’ | left | right | center | justify | ‘center ’ |
‘padding-top ’ | <length> | <percentage> | ‘5% ’ |
‘outline-color ’ | <color> | invert | ‘#fefefe ’ |
‘text-decoration ’ | none | underline || overline || line-through || blink | ‘overline underline ’ |
‘font-family ’ | [ <family-name> | <generic-family> ]# | ‘"Gill Sans", Futura, sans-serif ’ |
‘border-width ’ | [ <length> | thick | medium | thin ]{1,4} | ‘2px medium 4px ’ |
‘text-shadow ’ | [ inset? && [ <length>{2,4} && <color>? ] ]# | none | ‘3px 3px rgba(50%, 50%, 50%, 50%), lemonchiffon 0 0 4px inset ’ |
‘voice-pitch ’ | <frequency> && absolute |
[[x-low | low | medium | high | x-high] ||
[<frequency> | <semitones> | <percentage>]] | ‘-2st x-low ’ |
3.1. Pre-defined Keywords
In the value definition fields, keywords with a pre-defined meaning appear literally. Keywords are CSS identifiers and are interpreted case-insensitively within the ASCII range (i.e., [a-z] and [A-Z] are equivalent).
For example, here is the value definition for the ‘border-collapse
’ property:
Value: collapse | separate
And here is an example of its use:
table { border-collapse: separate }
3.1.1. CSS-wide keywords: ‘initial
’ and ‘inherit
’
As defined above, all properties accept the CSS-wide keywords, which represent value computations common to all CSS properties.
The ‘inherit
’ keyword is defined in [CSS21].
The ‘initial
’ keyword represents the specified value that is designated as the property's initial value. [CSS3CASCADE]
Other CSS specifications can define additional CSS-wide keywords. For example, [CSS3CASCADE] adds an ‘unset
’ keyword to this set.
5.1. Relative lengths
Relative length units specify a length relative to another length. Style sheets that use relative units can more easily scale from one output environment to another.
The relative units are:
5.2. Absolute lengths: the ‘cm
’, ‘mm
’, ‘in
’, ‘pt
’, ‘pc
’, ‘px
’ units
The absolute length units are fixed in relation to each other and anchored to some physical measurement. They are mainly useful when the output environment is known. The absolute units consist of the physical units (in, cm, mm, pt, pc) and the px unit:
h1 { margin: 0.5in } /* inches */ h2 { line-height: 3cm } /* centimeters */ h3 { word-spacing: 4mm } /* millimeters */ h4 { font-size: 12pt } /* points */ h4 { font-size: 1pc } /* picas */ p { font-size: 12px } /* px */
'Web > WEB기본' 카테고리의 다른 글
[CSS] 글자색상 -webkit-text-fill-color:initial (0) | 2014.01.07 |
---|---|
[CSS] 글 포인트 주기 border-left-width이용 (0) | 2014.01.02 |
[CSS] CSS 글 자간 줄간 설정 (0) | 2013.12.17 |
[CSS] 배경 이미지 고정하기 ( background-attachment 속성 ) (2) | 2013.11.14 |
[CSS] CSS 속성 inherit 상속받기 (0) | 2013.10.23 |
[CSS] Image vertical align with CSS, avoid absmiddle 효과 (0) | 2013.10.12 |
[CSS] CSS 애니메이션 처리 (0) | 2013.10.12 |
[CSS] webkit에서 사용되는 CSS text-align 속성값들 (0) | 2013.10.12 |
(로그인하지 않으셔도 가능)