DSGN53871
WEB DESIGN 1

Implementation Overriding

CSS code can override other existing CSS code depending on how it is implemented. Say you had redefined the <p> tag in an external stylesheet. If you redefine it again in the head section of a document, this definition will be the one that is used, as it is closer to the things that it affects. Adding css using the style attribute will override anything else that has been specified elsewhere.

Overriding-wise, the sheet imported last will override the imported ones that come before — i.e. in the example above, 'advanced.css' has more weight than 'style.css' because it is imported below it. Imported stylesheets have the least influence over the final presentation of a page overall, as linked sheets will override them. So we finally have a full cascade order:

the style attribute overrides
a style block, which overrides
a linked stylesheet, which overrides
an imported sheet.


<< Back


Interactive Multimedia ~ School of Applied Engineering and Computing Sciences ~ Sheridan