Hi-Angel
0
Q:

css align text

.class {
	text-align: center;
}
19
<switch>
    h1 {
    text-align: center;
}

p.date {
    text-align: right;
}

 
p.main {
    text-align: justify;
} 
</Switch>
4
/* 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. */
8
p{
    text-align:center;/*values: center, left, right, etc...*/
}
4
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)
1
body {
  text-align: center;
}
0

    div.a {
  text-align: center;
}


    div.b {
  text-align: left;
}


    div.c {
  text-align: right;
}

div.c {
  text-align: 
    justify;
}  
4
text-align: center;
0
body {
  text-align: left;
}
1
body {
  text-align: right;
}
1
text-align: justify;
2

New to Communities?

Join the community