Text Properties

There are many CSS properties available that allow you to style the text on your page. Here's a review of some of the more common ones

Property What it Changes Example
color The color of your text color: maroon;
text-align The alignment of your text text-align: center;
text-decoration Additional style text-decoration: underline;
font-family Which font to use font-family: fantasy;
font-size The size of your text font-size: 20px;

Styled Text Example

If we put this all together, you might get some text like this:

p {
  color: maroon;
  text-align: center;
  text-decoration: underline;
  font-family: fantasy;
  font-size: 20px;
}

This is my styled text! It's so klzzwxh:0000klzzwxh:0001klzzwxh:0002klzzwxh:0003

Specifying Fonts

You might notice when using CSS like font-family: fantasy; that your text looks different on different computers. This is because we're only telling the browser what kind of font to use, not which specific font.

W3 Schools Links

Found a bug in the documentation? Let us know at documentation@code.org