CSS TUTORIAL : Cascading and inheritance
Sample of the pdf document :
The final style for an element can
be specified in many different places, which can interact in a complex way.
This complex interaction makes CSS powerful, but it can also make it confusing
and difficult to debug.
Three main sources of style
information form a cascade. They are:
·
The browser's default styles for the markup language.
·
Styles specified by a user who is reading the
document.
·
The styles linked to the document by its author. These
can be specified in three places:
o In an
external file: this tutorial primarily discusses this method of defining
styles.
o In a
definition at the beginning of the document: use this method only for styles
that are used only on that page.
o On a
specific element in the body of the document: this is the least
maintainable method, but can be used for testing.
The user's style modifies the
browser's default style. The document author's style then modifies the style
some more. In this tutorial, you are the author of your sample document, and
you only work with author stylesheets.
Example:
When you
read this document in a browser, part of the style that you see comes from your
browser's defaults for HTML.
Part of the
style might come from customized browser settings or a customized style
definition file. In Firefox, settings can be customized in the Preferences
dialog , or you can specify styles in a file named userContent.css file in your browser profile.
Part of the
style comes from stylesheets linked to the document by the wiki server.
When you open your sample document in your browser,
the <strong> elements are bolder than the rest of the text.......
Click here for Download PDF / FREE
0 commentaires: