1. Home
  2. Computing & Technology
  3. Web Design / HTML

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

By , About.com Guide

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.
Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & 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

©2010 About.com, a part of The New York Times Company.

All rights reserved.