Inside JavaScript

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.

Категории