Basic CSS syntax: Measurements

  1. Basic CSS syntax
  2. Classes

The most common measurements used with style sheets are the percentage and the em-width, which we’ve already seen, and the pixel (px) and point (pt) which we haven’t. You should be very careful using static measurements such as pixels, points, and picas. They do not adjust themselves to the browser.

% a percentage of the element or an enclosing element, depending on context.
em the height of the current font (upper-case characters)
ex the height of the current font (lower-case characters)
mm millimeters
cm centimeters
in inches
pc picas: a pica is one sixth of an inch
pt points: a point is 1/72nd of an inch
px pixels

When you use “0”, you don’t need to specify a measurement: zero is the same no matter what the measurement is.

  1. Basic CSS syntax
  2. Classes