Home : Basic HTML/CSS tutorial : Stylesheets : More properties
Introduction
Why stylesheets?
Stylesheet syntax
More properties
Specific elements
Summary
< Previous: Stylesheet syntax

More properties

Margins

You can add a margin using the "margin-left", "margin-right", etc. properties. For example, this style would give all paragraphs a left margin of 100 pixels.

P
{
margin-left: 100px;
}

Line spacing

You can control line spacing with "line-height":

P
{
line-height: 30px;
}

Width

You can control the width of a block (inside its margins) using the "width" property. This works best with <div> tags (see next page).

DIV.main
{
width: 400px;
}