Different measures : measurement « Style Basics « HTML / CSS






Different measures

  


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Different measures</title>
  <style type="text/css">
    body {
      font-size: 12px;
    }
    h1 { 
      font: bold 1em/1.5em Georgia, serif;
      margin: 1em 0 0 0;
    }
    p {
      font: 1em/1.5em Georgia, serif;
      margin: 1em 0 0 0;
    }
    .one {
      margin: 0.5em 0 0 0;
      width: 28em;
    }
    .two {
      width: 33em;
    }
    .three {
      width: 38em;
    }
  </style>
</head>
<body>
  <h1>Georgia: 28em, 33em & 38em</h1>
  <p class="one">
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. </p>
  <p class="two">
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. </p>
  <p class="three">
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. this is a test. this is a test. 
  this is a test. </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.em is relative to the font size
7.Relative size font-size: .75em
8.width: size an element by assigning pixels, ems, a percentage, or another fixed measurement to width.
9.Percentages are more flexible because they can scale to the viewport.
10.width:100% stretches an element to the width of its parent.
11.Units of Length and Percentage
12.Absolute vs. Relative Measurements
13.one inch tall
14.inch measurement
15.font-size with various measurements
16.This font is 24 pixels tall and this div is 3 ems tall
17.The body's border is 1em thick
18.font-size: 1in
19.inch vs pixel
20.percentage measurement width
21.A negative margin
22.This paragraph has a 1 pixel thick, solid black border around it.
23.Comparing em to Pixels
24.This font is 1.2 smaller than the default size, or pixels.
25.em measurement
26.ex measurement
27.inch measurement 2
28.inch vs pixels
29.Em Measurement Comparison to Pixels
30.percentage measurement
31.12 pixel base