1. Technology

Box Elements and Block-Level Elements Are Key to XHTML Documents


3 of 4

Adjust the Look and Feel of Box Elements
Box Properties

Box Properties

Image courtesy J Kyrnin
  • margin
    The margin is the area around the outside of the box. This places space around the element that is transparent - in other words, it's the same color as the background.
  • border
    The border is a line around the box. The default is for it to be 0 pixels wide, and thus not visible.
  • padding
    The padding is space within the box itself. This is also transparent, but to the background color of the box object itself.
  • width
    The width is the width of the object, not including all borders, padding, and margins. Note that some browsers interpret this incorrectly, and include the width of margins, borders, and padding in the width of the object, so be sure to test your CSS in various browsers.
  1. About.com
  2. Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. HTML Tags
  7. Box Elements and Block Level Elements - Adjust the Look and Feel of Box Elements

©2014 About.com. All rights reserved.