/* Keyword values */
text-align: start;
text-align: end;
text-align: left;
text-align: right;
text-align: center;
text-align: justify;
text-align: justify-all;
text-align: match-parent;
/* Character-based alignment in a table column */
text-align: ".";
text-align: "." center;
/* Block alignment values (Non-standard syntax) */
text-align: -moz-center;
text-align: -webkit-center;
/* Global values */
text-align: inherit;
text-align: initial;
text-align: revert;
text-align: revert-layer;
text-align: unset;
body {
text-align: right;
}
h1 {
text-align: center;
}
h2 {
text-align: left;
}
h3 {
text-align: right;
}
p{
text-align:center;/*values: center, left, right, etc...*/
}
The different values of text-align are -
1) text-align: justify; (spreads throughout to the left and right)
2) text-align: center; (centers the text)
3) text-align: left; (the default value, shifts the text to left side)
4) text-align: right; (shifts the text to right side)
td {
text-align: center;
}
body {
text-align: left;
}
.p{
text-align:center;
}
<div class="p">
<p style="text-align:center">HELLO</p>
</div>