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>
Updated on: 2020-01-31T06:02:44+05:30

96 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements