Setting Font and Background Color

5/19/2021

Many web pages default to black text on a white background. This is easy to change! Do remember accessibility issues, however.

Font Color

In CSS, the color attribute is used to modify font color. This attribute accepts multiple color notations. The following example will change the font color for the body of the current page.

body {
    color: blue;
}

Background Color

In CSS, the background-color attribute is used to modify the background color. Like the color attribute, this accepts multiple color notations. The following example will change the background color used in the body of the current page.

body {
    color: blue;
    background-color: aliceblue;
}