View Single Post
Old 02-26-2011, 09:20 AM   #97
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
Just to add a final note on the whole style hierarchy/cascade thing - there's also a hierarchy in terms of where a style is defined.

There are three main places you can define CSS styles:

1. An external stylesheet (e.g. a file "style.css") referred to in the HEAD section of an HTML file using the LINK element, e.g.:
Code:
<link rel="stylesheet" type="text/css" href="../Styles/style.css" />
2. An embedded stylesheet contained in the HEAD section of an HTML file using the STYLE element, e.g.:
Code:
<style type="text/css">
p {
margin-top: 1em;
margin-bottom: 1em;
text-indent: 0.3em;
}
</style>
3. Inline styles applied to individual elements in the HTML code using the STYLE attribute, e.g.:
Code:
<p style="margin-top:1em;margin-bottom:1em;text-indent:0.3em;">bla bla bla</p>
As before, the "closer" it is to the HTML element, the higher a style is in the "hierarchy". So styles defined in an embedded stylesheet overrule styles defined in an external stylesheet, and styles defined in a STYLE attribute for an individual element overrule styles defined in an external stylesheet and/or an embedded stylesheet.
DMSmillie is offline   Reply With Quote