cthr
0
Q:

how to center align text in html

<!-- Code by Scratchy -->
<!-- Twitter: @S_cratchy-->

<!-- Solution 1 -->
<p>
  This is some cool text in html, wow such cool text
</p>

<!-- Solution 2 -->
<font style="text-align:right;"> This text is on the right</font>
<font style="text-align:center;"> This text is in the center</font>
<font style="text-align:left;"> This text is on the left</font>
2
<!-- Code By T64 -->

<!-- Solution -->
<p style="text-align: left">This text is aligned to the left side of the page</p>
<p style="text-align: center">This text is aligned to the center of the page</p>
<p style="text-align: right">This text is aligned to the right side of the page</p>

<!-- Output -->
This text is aligned to the left side of the page

				This text is aligned to the center of the page

                                 This text is aligned to the right side of the page

<!-- Website: https://installation.cf -->
2
<p style="text-align:center;">Centered paragraph.</p>
0
To text align all yuo have to do this:
<style>
  .yournameforclass {
    background: #fff; //which does not have to be there
    text-align: center;
    width: 100%;  //all of this can be varied. Text align can be used in these forms: left, which is to the left, right, to the right of the screen
    height: 300px;
  }
1
    text-align: center;
0
With the aid of internal or external CSS you can center text with:

text-align: center;
0
<p><center>YourText</center></p>
-1

New to Communities?

Join the community