(CSS)
Examples: Margins
jim.cerny@unh.edu  19-MAY-1998

Results.

This has a a left margin of 5 ems. Yadda, yadda, yadda. Seinfeld. Yadda, yadda, yadda.

This has a a left margin of 25 pixels and a right margin 150 pixels. Yadda, yadda, yadda. Seinfeld. Yadda, yadda, yadda.

This has a a left margin of .5 inch and a red box drawn around the paragraph. Yadda, yadda, yadda. Seinfeld. Yadda, yadda, yadda. Very cool.

Note the cascade here, which means there is inheritance from top to bottom as these styles are defined in-line.


Notes.

This example declares the styles in-line and uses the HTML DIV tag to restrict the range to which the styles apply. The DIV and SPAN tags are sometimes called "containers" because they can include a wide variety of other HTML tags and their primary use for things like this. The basic syntax for style declarations applies and is applied with a STYLE attribute on the DIV (in this case) tag:

<div style="margin-left: .5in; border-style: solid; border-width: thin; border-color: red; "> The DIV tag is a paired tag and requires: </div>