Units of Length and Percentage : measurement : Style Basics HTML CSS TUTORIALS


HTML CSS TUTORIALS » Style Basics » measurement »

 

Units of Length and Percentage


 


Unit  Definition                                                           Example

em    relative to the height of the font used in the element               h1 {margin:0.5em}

ex    relative to the height of the character 'x' for                      h2 {margin: 1ex
      the font used by the element
  
px    size based on the number of screen pixels                            p {font-size:12px}

in    in for inches (in = 2.54 cm)                                       {font-size: 0.5in}

cm    cm for centimetres                                                   p {font-size: 0.3cm}

mm    mm for millimetres                                                   p {font-size:3mm}

pt    pt for points (1pt = 1/72 inches)                                    {font-size:12pt}

pc    pc for picas (1pc= 12 points)                                        {font-size:1pc}

%     a percentage value relative to the value of the parent element,      p {line-height:120%
      depending on the properties used

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Style Basics
» measurement