what exactly is a style sheet?Before we begin describing how style sheets work, and how you use them, we should first answer the question, "what is a style sheet?" You don't need to know what we discuss in this section to work with style sheets, but for completeness sake, you might like to spend a few minutes reading it. If not, and you are ready to jump right in, you can move on now. What makes something a cascading style sheet?As we saw in the last section, the W3C has made two major CSS recommendations:
But what are these recommendations in technical terms? They are language specifications, which define a simple grammar or language. The grammar specifies what types of statement can be made within a style sheet. So, at this level, a style sheet is simply a text file (which has a .css suffix), written according to the grammar defined in the CSS1 or CSS2 recommendations. Here is a simple example. body h1 code .note Like an HTML document, a Cascading Style Sheet is just a simple text file. But unlike an HTML document, you don't need a special declaration at the top of the file to say that this is a style sheet. The name of the file should end with a .css suffix. In addition to being in .css files, style sheets can also be embedded into the next: how do they work?(C)1997-2001 Western Civilisation Pty. Ltd. |