CSS Text Alignment

CSS Text Alignment property is used to set horizontal alignment of text. We can set different alignment for text like center, left, right, justify etc. using text-align property.

Syntax:

text-align:justify;

text-align:left;

text-align:center;

text-align:right;

Example :

<html>
<head>
    <title>Learn Css text background color tutorials</title>
</head>
<body>
  <table width="100%" border="1" cellspacing="4" cellpadding="4">
  <tr>
    <td style="text-align:left;">Learn Css text left alignment tutorials by aryatechno</td>
    <td style="text-align:right;">Learn Css text Right alignment tutorials by aryatechno</td>
    <td style="text-align:center;">Learn Css text Center alignment tutorials by aryatechno</td>
    <td style="text-align:justify;">Learn Css text justify alignment tutorials by aryatechno</td>
  </tr>
</table>
</body>
</html>

Output :

Learn Css text left alignment tutorials by aryatechno Learn Css text Right alignment tutorials by aryatechno Learn Css text Center alignment tutorials by aryatechno Learn Css text justify alignment tutorials by aryatechno

 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

85519