MMDT1021 Chapter 2 Notes - page 3

 

Paragraph Alignment

Code Page

The old way:

<p>
Demo paragraph text. Demo paragraph text.
</p>

<p align="center">
Demo paragraph text. Demo paragraph text.
</p>

<p align="justify">
Demo paragraph text. Demo paragraph text.
</p>

<p align="left">
Demo paragraph text. Demo paragraph text.
</p>

<p align="right">
Demo paragraph text. Demo paragraph text.
</p>

The new HTML5 way:

<p style="text-align: center;">Aligns text to the center.</p>

<p style="text-align: justify;">Justifies text.</p>

<p style="text-align: left;">Normal left alignment. No need to specify.</p>

<p style="text-align: right;">Aligns text to the right.</p>

Result
Source

See this again with more text in the paragraphs.

 

Saving Your Web Page
  1. Do not use spaces or special characters in the name.
  2. Use all lower case.
  3. Use the correct extension.
    1. .htm
    2. .html
    3. .php
    4. .asp
    5. .cfm
    6. .txt
    7. .cgi
  4. Save it as text.

 

Viewing Your Web Page
  1. Microsoft Internet Explorer
  2. Mozilla Firefox
  3. Apple Safari
  4. Google Chrome
  5. Opera