Align in CSS3

The align property is used to specify to which place is align for content in box.
There are following properties of text-align.
1) text-align: left
2) text-align: right
3) text-align: center
4) text-align: justify

The text-align: left

Text-align: left; property is used for the left alignment of the content in content box.

<style type="text/css">
p{
text-align: left;
border: 1px solid black;
width: 100%;
}
</style>

<p>
Text align left property is applied on it.
</p>

Output of above code

Text align left property is applied on it.


The text-align: right

Text-align: right; property is used for the right alignment of the content in content box.

<style type="text/css">
p{
text-align: right;
border: 1px solid black;
width: 100%;
}
</style>

<p>
Text align right property is applied on it.
</p>

Output of above code

Text align right property is applied on it.


The text-align: center

Text-align: center; property is used for the center alignment of the content in content box.

<style type="text/css">
p{
text-align: center;
border: 1px solid black;
width: 100%;
}
</style>

<p>
Text align center property is applied on it.
</p>

Output of above code

Text align center property is applied on it.


The text-align: justify

Text-align: justify; property is used for the justify alignment of the content in content box.

<style type="text/css">
p{
text-align: justify;
border: 1px solid black;
width: 100%;
}
</style>

<p>
Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it.
</p>

Output of above code

Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it. Text align justify property is applied on it.








The Best

Comment here

If you have any query, if you want to know something about any of technical course related to computer science field, if you have any suggestion about relevant to uploaded content or if you anything wrong here (any mistake in content) than please contact us. Keep in mind, comment should be according to community guidelines.