Style Sheets


In general, I am completely against Style Sheets. This is just another poorly thought out level of complexity which makes it harder for content developers to control the display of their product.

To quote from the Web Design Group

The last thing I want to do is to loose control over how my page is presented. As far as platform independence, if UNIX is only 2% of the market, why should that be the primary driving force? The biggest problem with UNIX is that it reminds me of DOS on an XT. If it can't keep up with new ideas, then don't support it! :)
This example shows one advantage to style sheets. I have a table of test cases which are either Pass, Fail, or Not tested. It is useful to indicate this with different colors. However, on a normal laser printer italic and strike out are needed to see the differences.

The following style definitions are in the heading of this document.

   <STYLE type="text/css">
      td.p {color: green;  font-style: italic}
      td.f {color: red  ;  text-decoration: line-through }
      td   {color: black  }
   </style>
They are invoked by
   <td class=p>
   <td class=f>
   <td class= >
31 fb fa be   Description
2171 683 1464 2287 Test case 1
2176 684 ---- ---- Test case 2
*** IE 3.02 font control failure - THIS SHOULD BE RED
2176 685 ---- ---- Test case 3

   <td class=p>683<td> 
uses a little less space than the more traditional
   <td><font color=green><i>683<td> 
And it allows you to control the look of the page by just modifying a few lines verses changing every line in a table. However, it requires a browser with styles turned on.

In addition, there as an unexpected side affect - in IE 3.02, the <font color=red> tag won't work in the table as long as style sheets are enabled. (Of course IE 4.40 and Netscape Comunicator 4.05 render it correctly :) When the style sheets are disabled, then it works. The following line is copied from the table to here.

Like I said earlier, styles are not thought out very well. Use with caution.

(BTW, IE 4.40 incorrectly handles the <br> after Test case 2 and places the next line in column 1 instead of column 5.)


Browser Dependencies

IE 4.72 and Netscape Communicator 4.05 do not support style names which contain underscores. IE 5.0 does allow underscores.
  IE 4.72 IE 5.0 Netscape 4.05
table_bg Fail OK Fail
tablebg OK OK OK


Netscape Communicator 4.01a has a problem with <p>. It appears that </p> is required in various situations, particularly inside tables. This is particularly true when the table is inside a <div> block which is hidden via style sheets, though I've seen it both ways. (According to the standards, </p> is never required.)


In Dynamic HTML, Java Script can be used to hide and display sections in a namded block. However, Netscape Communicator 4.01a requires that a style sheet entry defines the position: absolute;


What web-text really needs is

References

Notice that strike out has been re-named line-through.
With standards like this, who needs enemies? :)
Author: Robert Clemenzi - clemenzi@cpcug.org
URL: http:// cpcug.org / user / clemenzi / technical / HTML_Examples / StyleSht.htm