em padding:2px; : em « Style Basics « HTML / CSS






em padding:2px;

  

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>A Demonstration of the Box Model</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type='text/css'>
body, h1, p {
  border:solid 2px #000000;
  padding:5px; 
  margin:4px;
  font-family:arial, verdana, sans-serif;}

b, em {
  border:solid 2px #999999;
  padding:2px;
  margin:23px;}
</style>


</head>

<body>
  <h1>Box Model Demonstration</h1>
  <p>As you can see from this simple demonstration, each element is treated as if it lives in its own <b>box</b>.</p>
  <p>Every element has a border around it, and some boxes can <em>contain</em> other boxes. </p>
</body>
</html>

   
    
  








Related examples in the same category

1.Stylizing your text with EM and STRONG
2.Emphasis tag
3.Set em in a form to have underline text decoration and normal font style
4.Change em font
5.E in LI
6.em border:solid 2px #999999;
7.em margin:23px;