<!DOCTYPE html>
<html>

<head>
  <title>Understanding the Box Model</title>
  <style>
    body {
        color:#000000;
        background-color:#ffffff;
        font-family:arial, verdana, sans-serif; 
        font-size:12px;}

    body, h1, p, img, b {border-style:solid; border-width:2px; border-color:#000000; padding:2px;}
    #round              {border-radius:10px;}
    #tight              {border-radius:10px; display:inline-block}
    h1, b               {background-color:#cccccc;}
  </style>
</head>

<body>
<h1>Box Related Properties</h1>
<p class="description">When you are styling a web page with CSS page you must start to think in terms of <b>boxes</b>.</p>
<p>Each element is treated as if it generates a new box. Each box will have a "margin", a "border", "a padding" and "content".</p>
<img src="img/boxmodel.gif" alt="How CSS treats a box">
<p>As you can see from the diagram above, each box can have a <b>border</b>. Between the content and the border you have <b>padding</b>, and outside of the border you have a <b>margin</b> to separate this box from any neighboring boxes. </p>

<p id=round>I can even have a box with rounded corners using <b>border-radius</b> property </p>
<p id=tight>This box only fits the size of text using the <b>display:inline-block</b> property.</p>
</body>
</html>