TEXT ALIGNMENT - HTML TUTORIAL 6 STUDENTSBLOG100


It is possible to align text at right,left or center in the display area. To align texts, we can use div tags or any cascading style sheet properties CSS.
The texts can be aligned in center of the display area,left of the display area and right of the display area.

Center Alignment:
For center alignment alone, two methods can be used in HTML.

Syntax:
  • <center> ........... </center>
  • <div align="center"> ............. </div>

Right Alignment:
For right alignment, following method is used in HTML.

Syntax:
  • <div align="right"> ............. </div>

Left Alignment:
For left alignment, following method is used in HTML.

Syntax:
  • <div align="left"> ............. </div>

Example Program:
Output:
One method to align anything at center
Another method to align text at center
Method to align text at left
Method to align text at right

Lesson 5  Previous | Main Page | Next  Lesson 7
Previous
Next Post »