xxxxxxxxxx
/* 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;
xxxxxxxxxx
/* To center text, you need to use text-align. */
.centerText {
text-align: center; /* This puts the text into the center of the
screen. */
}
/* There are also other things that you can use in text-align:
left, right, and justify. Left and right make the test align to the
right or left of the screen, while justify makes the text align both
sides by spreading out spaces between some words and squishing others. */
xxxxxxxxxx
/* CSS */
P { text-align: center }
H2 { text-align: center }
/* HTML - style in line */
<p style="text-align: center;"> text </p>
xxxxxxxxxx
/* Character-based alignment in a table column */
text-align: center;
/* The inline contents are centered within the line box. */
xxxxxxxxxx
/*style-part*/
.center{
text-align:center;
}
<!--html-part-->
<p class="center"> How to text align </p>