CSS Properties

Text Alignment and Text Direction

  • text-align
  • Direction
  • vertical-align
  • text-align-last
text-align

It specifies alignment of text. We can set this property to left, right, center, or justify.

Example:

p{
text-align : right;
}


Direction

It specifies the text direction. We can set this property to either ltr (left to right) or rtl (right to left).

Example:

h1{
direction : rtl;
}


vertical-align

It specifies the vertical positioningof the text in the element. We can set this property to baseline, sub, super, top, text-top, middle,bottom,text-bottom or specify in the form legth or percentage value.

Example:

.sp{
vertical-align : super;
}


text-align-last

The text-align-last property specifies how to align the last line of a text. It will only work for elements with the text-align property set to "justify". We can set this property to auto, left, right, center,justify, start, or end.

Example:

p{
text-align : justify;
text-align-last : right;
}


Cristle Academy

Compiler