CSS Data Types
CSS Data Types
R. Scott Granneman
Jans Carton
<image> <resolution>
<integer> <shape>
Images
<url>
<gradient>
<image>
<url>
<number>
<percentage>
<length>
<color>
<integer>
Units
» Absolute
» Font-relative
» Viewport-percentage
Pixel means
picture element
mm
cm
in
pt
pc
in = 96px (about an inch)
ex
ch
rem
em
ex 5.5 1 1 1 1 1
ch 9 — 27 1 — ?
» keyword
» #hex
» rgb()
» rgba()
» hsl()
» hsla()
<resolution>
<ratio>
No units!
Examples
4/3: traditional TV
16/9: widescreen TV
Units
» dpi: dots per inch
» dpcm: dots per centimeter
» dppx: dots per px unit
<resolution> 9 —* 29 3.5 —* —*
dppx ? — 29 16 — —*
<time>
<timing-function>
<angle>
<shape>
<frequency>
<blend-mode>
difference multiply
exclusion normal
<blend-mode>
<frequency>
Units
» Hz: Hertz
» kHz: kilohertz
<frequency> — — — — — —
Thank you!
[email protected]
www.granneman.com
ChainsawOnATireSwing.com
@scottgranneman
[email protected]
websanity.com
CSS Data Types
One of Those Things You Just Have To Know
R. Scott Granneman
Jans Carton
Attribution. You must give appropriate credit, provide a link to the license, and indicate if changes were
made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you
or your use. Give credit to:
Share Alike. If you remix, transform, or build upon the material, you must distribute your contributions
under the same license as the original.
No additional restrictions. You may not apply legal terms or technological measures that legally restrict
others from doing anything the license permits.