i2tutorials

CSS text-align

CSS text-align

 

This property defines the horizontal alignment of the text.

 

Possible values:

 

 

Example:

 

<html>
 <head>
 </head>
<style>
h1{
color:red;
}
h2{
color: blue;
}
</style>
 <body>
 <h1> text-align proeprty</h1>

 <h2 style = "text-align: center;">
    text-align: center;
  </h2>

  <h2 style = "text-align: right;">
               text-align: right;
  </h2>

  <h2 style = "text-align: left;">
    text-align: left;
  </h2>
  <h2 style = "text-align: justify;">
    text-align: justify; enter content here enter content here enter content here enter content here enter content here enter content here enter content here
  </h2>

        </body>
</html>

 

OUTPUT:

 

CSS text-align

 

Exit mobile version