learn web technologies, the easy way

Overiding an External CSS Style Sheet - page 2

There is another way to use a local style, and this one is even more local than the other. This involves using the "style" option within a standard HTML tag.

Using the same example as before, where you defined the <H1> as being BLACK 16pt ARIAL in the master CSS file. But you need to have the <H1> in RED. You can simply insert the style information into the <H1> tag as shown below:

<H1 style="color:red" >

You can add as many style selectors as you want, for example:

<H1 style="color:red; font-size:12px; margin:5px;" >

The more style information you embed in a HTML tag, the more difficult it is to update and keep track of the local styles. To repeat, this type of 'style localization' should only be used when absolutely necessary.

A more advanced way to achieve the same effect without locally inserting style information. This technique will shown soon in a new lesson entitled "A Bit More Advanced, a Lot More Power".