|
September 1, 2000 Resolving Conflicting Styles Tips: September 2000
Yehuda Shiran, Ph.D.
|
|
You can define an element's style in many different ways. There is a pre-defined priority order between these methods. An element's own scripting always has the highest priority. Its own inline STYLE is next, and own inline CLASS is after that. Inherited scripting, STYLE, and CLASS are in lower priority, in this order. The following examples demonstrate this concept:
Notice the style assignment hierarchy: setting color by inherited CLASS
Here is the HTML code for the example above:
Notice the style assignment hierarchy: setting color by inherited inline STYLE
Here is the HTML code for the example above:
Notice the style assignment hierarchy: setting color by inherited scripting
Here is the HTML code for the example above:
Notice the style assignment hierarchy:
setting color by own CLASS
Here is the HTML code for the example above:
Notice the style assignment hierarchy: setting color by own inline STYLE
Here is the HTML code for the example above:
Notice the style assignment hierarchy: setting color by own scripting
Here is the HTML code for the example above:
Learn more about the subject in Column 66, Dynamic Styles.
People who read this tip also read these tips: Look for similar tips by subject: |