CSS Basic Tutorial
CSS Flexbox
In CSS, text styling plays a crucial role in defining the appearance of content. There are several properties in CSS that allow you to control the font, alignment, spacing, decoration, and other visual aspects of text.
The color
property sets the color of the text.
color : color | transparent | initial | inherit;
The text-align
property aligns the text within its containing element.
text-align : left | right | center | justify;
This is the first paragraph.
Currently Active Property:
The font-family
property specifies the typeface of the text. You can provide a list of fallback fonts.
Try it yourself
The font-size
property controls the size of the text.
font-size : <value>;
Value: Can be specified in various units such as pixels (px
), percentages (%
), ems (em
), rems (rem
), viewport units (vw
, vh
), or keywords like auto
and inherit
.
The font-weight
property sets the thickness (or boldness) of the text.
font-weight : normal | bold | lighter | bolder | 100-900;
See Text Color
Currently Active Property:
The font-style
property sets the thickness (or boldness) of the text.
font-style : normal | italic | oblique;
See Text Color
Currently Active Property:
The text-decoration
property is used to set decorations like underlines, overlines, or strikethroughs.
text-decoration : none | underline | line-through | overline;
See Text Color
Currently Active Property:
The text-transform
property controls the capitalization of the text.
text-transform : none | uppercase | lowercase | capitalize;
See Text Color
Currently Active Property:
The line-height
property controls the space between lines of text (leading). It’s often used to improve readability.
line-height : <value>;
Value: Can be specified in various units such as pixels (px
), percentages (%
), ems (em
), rems (rem
), viewport units (vw
, vh
), or keywords like auto
and inherit
.
The letter-spacing
property controls the space between individual characters.
letter-spacing : <value>;
Value: Can be specified in various units such as pixels (px
), percentages (%
), ems (em
), rems (rem
), viewport units (vw
, vh
), or keywords like auto
and inherit
.
The word-spacing
property controls the space between words.
word-spacing : <value>;
Value: Can be specified in various units such as pixels (px
), percentages (%
), ems (em
), rems (rem
), viewport units (vw
, vh
), or keywords like auto
and inherit
.
The text-indent
property controls the indentation of the first line of text.
text-indent : <value>;
Value: Can be specified in various units such as pixels (px
), percentages (%
), ems (em
), rems (rem
), viewport units (vw
, vh
), or keywords like auto
and inherit
.
The white-space
property controls how whitespace is handled, including spaces and line breaks.
white-space : <value>;
Value: Can be specified in various units such as pixels (px
), percentages (%
), ems (em
), rems (rem
), viewport units (vw
, vh
), or keywords like auto
and inherit
.
Try it yourself
The text-shadow
property adds shadows to the text, with options for the shadow's position, blur radius, and color.
text-shadow : [horizontal offset] [vertical offset] [blur radius] [color];
Try it yourself