Alignment

Section 1 - Introduction
Section 2 - Basics
      Your first page
      Formatting
         Paragraphs
         Divisions
         Headings
         Alignment
         Breaks
         Horizontal Lines
         You Try It!
      Text tricks
      Pictures
      Links
      Backgrounds
Section 3 - Next Level
Section 4 - Advanced
Section 5 - Publishing
Section 6 - Extras
Appendices
Alignment
This is found within other tags
Now that you know how to make paragraphs, headings and divisions, you can learn how to align them. To align a paragraph, you add a little bit of code to the paragraph tag. Here's what it looks like:
<p align="center"> or <p align="right">
Code
<p align="center">This is cool.</p>
<p align="center">This is the way a longer paragraph looks when it is centered. As you can see, it changes the overall shape of the paragraph and makes it more challenging to read. This tag is useful though, especialy when trying to align items to the center of the page.</p>

<p align="right">Cool too!</p> <p align="right">This is the way a longer paragraph looks when it is right aligned. As you can see, it changes the overall shape of the paragraph and makes it shift to the right edge. This tag is useful though, especialy when trying to align items to the right of the page.</p>
What you see

This is cool.

This is the way a longer paragraph looks when it is centered. As you can see, it changes the overall shape of the paragraph and makes it more challenging to read. This tag is useful though, especialy when trying to align items to the center of the page.

Cool too!

This is the way a longer paragraph looks when it is right aligned. As you can see, it changes the overall shape of the paragraph and makes it shift to the right edge. This tag is useful though, especialy when trying to align items to the right of the page.


You can align a lot of things. Align divisions! Align paragraphs! Align headings! The code is the same. Here's how you do it:
Centering
<p align="center"> and then, of course, </p>
<div align="center"> and then, of course, </div>
<h2 align="center"> and then, of course, </h2>

Right align
<p align="right"> and then, of course, </p>
<div align="right"> and then, of course, </div>
<h2 align="right"> and then, of course, </h2>
Useful! Please try these!
Back Home Forward