margin

Values: auto, px, and % (and others): e.g.: margin:10px;
boxModel

margin specifies the space around an element, outside the border. Also, the background color/image of the element will not effect the margin area as well-- it will be inherited from the parent element. Block-level elements by default will fill up their containing element from left side to right side while inline elements are generally only as big as they have to be to display their content. It is actually a shorthand property that can be used to set margin-left, margin-right, margin-top, and margin-bottom all at once to the same value or separately (see w3schools for details)

See Box Model, width, height, border, and padding for details on each.

Centering Block-level Elements

You can use use margin-left:auto and margin-right:auto to center block-level elements:

    div.centered{
        margin-left:auto;
        margin-right:auto;
    }

W3Schools: Box Model
W3Schools: margin

Back to Knowledge Dump