HTML and CSS Reference
In-Depth Information
Chapter 3
Specifying Sizes, Colors, and Files
In the preceding chapter, you used a keyword to set the value of the cursor property. Many CSS properties use
predefined keywords, but sizes, colors, and the location of files need to be specified individually. This chapter
describes the units of measurement and the syntax used to specify colors and files. CSS3 introduces several new
units of measurement, which are only gradually being implemented by browsers, so you need to use them with
caution.
In this chapter you'll learn about the following:
Which units of measurement to use for visual browsers and printers
Understanding the difference between physical pixels and CSS pixels
Specifying colors by name
Which color formats are supported in CSS
Setting color transparency
Specifying the location of files, such as background images
This chapter contains a lot of dry, factual information; but it's essential reading for working with CSS.
Fortunately, it's relatively short. It should also act as a handy reference.
Specifying Size and Other Units of Measurement
In CSS, values not expressed as a keyword take one of the following forms:
Integer
Number
Length
Percentage
Angle (CSS3)
Time (CSS3)
Numeric Values
Using numeric values is straightforward. Some properties expect an integer —in other words, a whole number.
Others accept either a whole number or a decimal value. The CSS2.1 specification makes no distinction, and
 
Search WWH ::




Custom Search