• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Hour 15. Using Style Sheets > CSS1 Versus CSS2

CSS1 Versus CSS2

There are actually two different languages to choose from when you make a style sheet. The one I recommend you use is called cascading style sheets, level 1 (CSS1) because it is compatible with both Netscape Navigator 4 (or later) and Microsoft Internet Explorer 4 (or later). The new CSS2 standard is only partially implemented in the current crop of browsers, and neither Netscape nor Microsoft is currently claiming that its next version will fully support CSS2. They do already support some parts of CSS2, such as the capability to precisely position text and graphics on the page (discussed in “Specifying Inline Styles,” later in this hour).

You might be wondering where the phrase cascading style sheets comes from. It is due to the fact that each style sheet can be considered to overlap or cascade over the previous one. As an example, consider the style sheet in Figure 15.3. By default, the h1 tag of HTML will create bold text with a larger font than normal. However, the set of rules in Figure 15.3 will be applied instead so that they will hide or cascade over the default ones. All rules defined in the style sheet will cascade over the HTML rules.

If a set of rules in a style sheet does not override one of the behaviors of an HTML tag, that behavior will apply along with any new rules defined in the style sheet. For example, if a style sheet defined the rule

h1 {

then any text surrounded by this tag will appear in the usual h1 form, only will be blue.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint