Re: <STYLE>hover</STYLE>

by =?iso-8859-1?Q?St=E9phane?= Bergeron <stephberg(at)videotron.ca>

 Date:  Wed, 09 Feb 2000 17:51:29 -0500
 To:  hwg-techniques(at)mail.hwg.org
 References: 
  todo: View Thread, Original
At 11:54 AM 09/02/00 -0800, Roger Harness wrote:
>Forgive me for asking such a probably simple question, but does anyone know
>a good source of information about these tags:

Hi Roger,

First thing is that these are not "tags" (well the style tag is=20
obviously... ) but they are CSS rules.  CSS rules are comprised of a=20
Selector (like A:LINK) and a Declaration (like {text-decoration:=20
none;}).  The declaration is further divided into a Property (like=20
text-decoration:) and a Value (like none).


><STYLE>
>A:link {text-decoration: none}
>A:link {color: #FFBB00}
>A:visited {text-decoration: none}
>A:visited {color: #FF9F00}
>A:hover {color: #99CCFF}
>A:hover {text-decoration: underline}
></STYLE>
>
>I'm fairly fluent in HTML, but know next to nothing in anything else (java
>script, java, css etc.)
>IS this actually a form of css??

This is an example of an embedded style sheet yes, but it should be written=
=20
a bit differently.  The STYLE tag should contain a TYPE attribute,  the=20
whole style sheets should be surrounded by a comment tag, the Declarations=
=20
should end with a semi-colon and each selector is repeated twice which is=20
not wrong in itself but needlessly redundant.  It should probably be this=
 way:

<STYLE TYPE=3D"text/css">
<!--
A:LINK {
         text-decoration: none;
         color: #FFBB00;}
A:VISITED {
         text-decoration: none;
         color: #FF9F00;}
A:HOVER {
         text-decoration: underline;
         color: #99CCFF;}
-->
</STYLE>

>Is it just an IE5 thing? Is there anything as simple for netscape or lower
>versions of IE? Will this do any damage to a page in anything other then
>IE5??

Like others have said, CSS has been supported as early as in IE 3.0x (in a=
=20
very limited way), much better in IE 4.0, and even better in IE 5 and=20
5.5.  Netscape's support is limited to version 4.x (and the new NN 5 with=20
Gecko) but in version 4 its support is very incomplete and extremely=20
buggy.  You better do some thorough testing in NN 4 before you go live with=
=20
any CSS enhanced pages.  One of the beauty of CSS is that browsers who do=20
not support it (NN 3.0 and lower, etc) will ignore the style sheets=20
completely and will default to the HTML markup stylings.

Others have provided good Web resources on CSS.  A great book to get you=20
started would be Professional Style Sheets for HTML and XML published by=20
Wrox Press.

HTH!

St=E9phane Bergeron

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA