Adding Style Inlinefor situations in which a quick fix for a single element is called for, or in rare cases when it's the only style for one unique element in an entire site. Consider the following element: <h1>Welcome!</h1> If this header were part of a complete HTML document and you viewed it in a browser, the results would be equivalent to Figure 7-1. Figure 7-1. Default size of an H1 as defined by browser styles.
Say you don't like the default color and size. You can add CSS rules directly to the element using the style attribute: <h1 style="color: gray; font-size: 24px;">Welcome!</h1> Now you've got a gray header sized at 24 pixels (see Figure 7-2). Figure 7-2. Redefining color and size using inline style.
|
| |||||||||||||||||||