ex measurement : measurement « Style Basics « HTML / CSS






ex measurement

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title> ex measurement </title>
        <style type='text/css' media='all'>
          * {
            font-size: 62px;
            color: white;
            margin: 25px;
          }
          body {
            background: gray;
          }
          p#serif {
            font-family: serif;
            background: black;
            line-height: 1ex;
          }
          p#sans {
            font-family: sans-serif;
            background: black;
            line-height: 1ex;
          }
          p#monospace {
            font-family: monospace;
            background: black;
            line-height: 1ex;
          }
          p#cursive {
            font-family: cursive;
            background: black;
            line-height: 1ex;
          }
          p#fantasy {
            font-family: fantasy;
            background: black;
            line-height: 0;
            height: 1ex;
          }
        </style>
    </head>
    <body>
        <p id='serif'>
      x
        </p>
        <p id='sans'>
          x
        </p>
        <p id='monospace'>
          x
        </p>
        <p id='cursive'>
          x
        </p>
        <p id='fantasy'>
          x
        </p>
    </body>
</html>

   
  








Related examples in the same category

1.Absolute Units
2.Relative Units
3.Testing 96 DPI Equals an Inch
4.This paragraph has a 200 pixel width and 10 pixels of padding
5.Relative units giving rise to unequal side margins
6.Different measures
7.em is relative to the font size
8.Relative size font-size: .75em
9.width: size an element by assigning pixels, ems, a percentage, or another fixed measurement to width.
10.Percentages are more flexible because they can scale to the viewport.
11.width:100% stretches an element to the width of its parent.
12.Units of Length and Percentage
13.Absolute vs. Relative Measurements
14.one inch tall
15.inch measurement
16.font-size with various measurements
17.This font is 24 pixels tall and this div is 3 ems tall
18.The body's border is 1em thick
19.font-size: 1in
20.inch vs pixel
21.percentage measurement width
22.A negative margin
23.This paragraph has a 1 pixel thick, solid black border around it.
24.Comparing em to Pixels
25.This font is 1.2 smaller than the default size, or pixels.
26.em measurement
27.inch measurement 2
28.inch vs pixels
29.Em Measurement Comparison to Pixels
30.percentage measurement
31.12 pixel base