Others




Text Properties - CSS


CSS Text properties are used to change text appearnce like color, text alignment, decoration, indentation, letter spacing, and word spacing.

Property Description Values Example
color Sets the color value of a text hex, rgb, color names
p{
  color:green;
}
text-align Sets the horizontal alignment of text. left,right,center,justify
p{
  text-align:right;
}
text-decoration Specifies the decoration to text. none, undeline, overline, line-through
p{
  text-decoration:undeline;
}
text-indent Specifies the first line indentation in a text. length(px, pt, cm), %
p{
  text-indent:10px;
}
text-transform Specifies the letter case to text. none, uppercase, lowercase, capitalize
p{
  text-transform:uppercase;
}
letter-spacing Specifies the space between characters in a text. normal, length(px, pt, cm)
p{
  letter-spacing:15px;
}
word-spacing Specifies the space between words in a text. normal, length(px, pt, cm)
p{
  word-spacing:15px;
}
vertical-align Sets the vertical alignment of text. sub, super, top, middle, bottom
p{
  vertical-align:middle;
}
line-height Specifies the height of a line. normal, length(px, pt, cm), %
p{
  line-height:15px;
}
Color
p{
  color:green;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.

text-align
p{
  text-align:center;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.

text-decoration
p{
  text-decoration:undeline;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.

text-indent
p{
  text-indent:50px;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.

text-transform
p{
  text-transform:uppercase;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.

letter-spacing
p{
  letter-spacing:15px;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.

word-spacing
p{
  word-spacing:15px;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.

line-height
p{
  line-height:35px;
}
Try it Yourself

The trees, therefore, must be such old and primitive techniques that they thought nothing of them, deeming them so inconsequential that even savages like us would know of them and not be suspicious.