More on Styles

What's New: Color

In this page we apply colors to the text and the background. The color of the h1 head is given as one of the named colors that HTML knows about, maroon.

What's New: Relative Sizes

Font sizes are given in terms of the em, which is the size of the current parent. 2em means twice the size of the body text, in this case. If the user specifies larger or smaller text sizes, using View/Text Size in the browser, everything changes in proportion.

What's New: Margins

For the body, we specify left and right margins of 10%. That's 10% of whatever the current size of the browser is; the margins thus change as the user resizes the window. The h2 head is outdented, meaning that it extends to the left of body text.

What's New: Inheritance

Note that there is no color specified for the h2 text. But since h2 is a child of body, it will have the same color as the body text.