Enter the element's tag name to target those elements:
p {
color: aqua;
}
To target elements that are descended from another element, use a selector for the ancestor, then a space, then a selector for the descendant:
p em {
font-weight: bold;
}
#special .fancy {
color: fuchsia;
}
Use px, em, or a single number as units.
p {
line-height: 20px;
}
p {
font-variant: normal;
font-variant: small-caps;
text-transform: lowercase;
text-transform: capitalize;
text-transform: uppercase;
}
The color property changes the color of the text.
p {
color: red;
color: #ff0000;
color: rgb(255, 0, 0);
color: rgba(255, 0, 0, 0.7);
}
Colors can be represented as color names, hexadecimals, RGB colors, or RGBA colors.
body {
background-color: black;
}
Use CSSFontStack.com to generate a web-safe font.
body {
font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
}
Use px, em, or % as units.
p {
font-size: 32px;
}
p {
font-style: normal;
font-style: italic;
font-style: oblique;
font-weight: normal;
font-style: bold;
}
p {
text-align: left;
text-align: right;
text-align: center;
}