Using Margin, Indentation, and Alignment Styles


Here are some of the properties you use to work with margins, indentations, and alignments:

  • margin-left specifies the left margin.

  • margin-right specifies the right margin.

  • margin-top specifies the top margin.

  • text-indent specifies the indentation of text.

  • text-align specifies the alignment of text.

Here's an example showing how to put some of these properties to work:

(Listing 21-07.html on the web site)
 <HTML>      <HEAD>          <TITLE>              Margin And Alignment Styles          </TITLE>  <STYLE type="text/css">   BODY {margin-left: 15px}   P {text-indent: 30px}   H1 {text-align: center}   </STYLE>  </HEAD>  <BODY>   <H1>   Margin And Alignment Styles   </H1>   <P>   Here is an indented paragraph.   </P>   </BODY>  </HTML> 

You can see the results in Figure 21.3.

Figure 21.3. Using margin styles.

graphics/21fig03.gif



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net