How to Use CSS3’s Text-Align Property

Published November 3, 2016 by CSS Newbies.

CSS3’s text-align property defines how text should be horizontally aligned in relation to its parent element. You can use it to align text left (this is the default value), center, or right.

Screen Shot 2016-10-30 at 2.50.50 PM

The default value (text-align: left) is shown above. Here’s how you would center align text:

p{
text-align: center;
}

Screen Shot 2016-10-30 at 2.50.18 PM

To align your text to the right, use the following code:

p{
text-align: right;
}

Screen Shot 2016-10-30 at 2.51.09 PM

 

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>