[ClubM8] --> Click HERE to Find Friends or.. Love!
by elektra
First introduced in 1996 by the World Wide Web Consortium1, Cascading Style Sheets (CSS) serve an important role for specifying the appearance of HTML pages. Style sheets help you influence the way your HTML pages look in a way that is far more efficient that the HTML element-by-element techniques used in the past. With advances in Web browser technologies, CSS level 22, should be now available to many users, and CSS Level 3 is in development3.
The overall purpose of style sheets are to help people who write HTML to separate the content of a Web page from specifications of how it looks. Style sheets are used to influence HTML page appearance. For example, HTML writers might want to indent the first line of each paragraph by five spaces. To do this the old way, they would place the (non-breaking space) entity five times at the start of each paragraph. This worked fine for pages generated by HTML editors, or even on a small scale for hand-prepared HTML pages. But what if the Web designer decided that the paragraphs should not have the first line of each paragraph indented? It would be a laborious process to have to go through all the HTML pages to remove the entities.
Rather than specify the appearance of elements in an HTML file, writers need a way to specify the appearance of an entire set of HTML pages all in one place, separate from the HTML content. Style sheets make this possible. You can use style sheets to efficiently create a consistent look and feel for your web and change this look and feel quickly and easily.
You create a style sheet in a file using a command syntax that describes how HTML elements in your files should be rendered in a Web browser. In your HTML files, you identify this style sheet file. When a user accesses your HTML pages, the Web browser refers to your style sheet file to display your HTML pages.
Using style sheets, you can tell a Web browser how to display HTML elements such as margins, point sizes, text background colors, and many others. For example, you can influence the margin spacing used in every P (paragraph) element in your HTML pages on your Web site. Using variations within style sheets called classes, you can create different styles of an HTML element.
For example, let's say you have a need for cautionary statements in your document. One such paragraph class could be a statement of warning, another paragraph class could be a statement of imminent danger. You would like Web browsers to display these paragraph classes in different ways--the danger in red, bold, and underlined text; the warnings in purple and bold text.
In your style sheet file, call it Test.css, you would place these statements to affect the appearance of the P (paragraph) element:
In your HTML files, you identify the style sheet you are using (mystyle.css), and then you can then use these classes to label statements.
Your users will need to have more recent versions of the popular Internet Explorer (3.0 or above) or Netscape Navigator (4.0 or above) in order to see the style effects. If your users don't have these style-enabled browsers, they won't see all the effects you create. Therefore, in using style sheets, like many other kinds of new HTML elements that have come before, you will need to be sensitive to users who do not have the most current Web browser software.
With a little common sense and creativity, you you can still meet the needs of users who cannot use the style sheets. In fact, when you use style sheets, you can avoid much of the kind of syntax gymnastics that HTML writers have had to put into their pages to make things "look right." The result is that your HTML pages can be leaner and more easily displayed in all Web browsers. And instead of fiddling with how your Web pages look, you can focus on what your Web pages mean.