Computer >> Computer tutorials >  >> Programming >> Javascript

Align the text of a document with CSS


The text-align property is used to align the text of a document. Possible values are left, right, center, justify.

Example

You can try to run the following code to align text:

<html>
   <head>
   </head>
   <body>
      <p style = "text-align:right;">
         Asia is a continent.
      </p>
      <p style="text-align:center;">
         Asia is a continent.
      </p>
   </body>
</html>