Re: "link" properties using style sheets-nuances...

by "Kehvan M. Zydhek" <kehvan(at)zydhek.net>

 Date:  Thu, 17 Jan 2002 13:32:02 -0800
 To:  "Michael Boyer" <galdor7(at)hotmail.com>,
<hwg-style(at)hwg.org>
 References:  hotmail
  todo: View Thread, Original
Michael,

A lot of people on the list are suggesting multiple link classes this way:

a:link {declaration}
a.council:link {declaration}
a:link.council {declaration}

You yourself mention that IE and Netscape prefer one or the other method,
but not both (and not the same).

May I suggest my method? That would be to set up default styles for links:
a:link {declaration}
a:visited {declaration}
a:hover {declaration}
a:active {declaration}

And then to add additional styles for specific links:
.council:link {declaration}
.council:visited {declaration}
.council:hover {declaration}
.council:active {declaration}
.anotherlink:link {declaration}
.anotherlink:visited {declaration}
.anotherlink:hover {declaration}
.anotherlink:active {declaration}

(Rob Atkinson on HWG:Techniques pointed out the proper sequencing of the
four link classes; I had been putting ACTIVE first -- which doesn't work --
but didn't realize it didn't work because my ACTIVE scheme is almost always
the same as my LINK scheme)

Then, when you want a default link, you simply use <.a href="link>link</a>.
When you want the COUNCIL link you use <.a style="council"
href="link">link</a>.
For the third, optional link, you use <.a style="anotherlink"
href="link">link</a>, adding additional link styles as necessary.

I've tested this in all modern Windows browsers (IE5.5/IE6.0, Netscape
6.0-6.21, Mozilla GECKO 0.9.0 and up, Opera 5.x/6.x, and AOL 5/6/7) and I've
not had any problems with it. For me, I could never get the unique linking
styles to work by adding the "a" classifier to the unique styles anywhere.

You may want to give this method a try. It may solve your problem. Be aware
that I've only been able to test this in Windows browsers, but I've not
gotten any mentions of it not working in browsers for other OSs like MacOS
or Linux...

Good luck!

Kehvan

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: NORTON ANTI-VIRUS 2002 scanned this email prior to sending. It is free
:: of any known embedded or attached viruses, trojans, or internet worms.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


----- Original Message -----
From: "Michael Boyer" <galdor7(at)hotmail.com>
To: <hwg-style(at)hwg.org>
Sent: Thursday, January 17, 2002 11:43
Subject: Re: "link" properties using style sheets-nuances...


> Just a quick tid-bit I discovered. Some of you showed me how to specify
link
> classes as follows:
>
> a.council:link { text-decoration: none;
> background-color: #426EFC;
> color: #FFFF80;
> font-size: 12pt;
> font-family: arial;
> font-weight: bold;
> }
>
> and some of you showed me how to do it this way:
>
> a:link.council { text-decoration: none;
> background-color: #426EFC;
> color: #FFFF80;
> font-size: 12pt;
> font-family: arial;
> font-weight: bold;
> }
>
> In playing with the two different ways, I've discovered that IE and
Netscape
> are particular about which way it is done. Netscape likes the first way,
and
> IE the second. Reversing them and they are buggy to the point of
worthless.
> Just thought I'd further the information about this for everyone. ;-)
>
> Thanks again for the help!
>
> Michael Boyer
> Technology Support Specialist
> City of Westbrook, ME
> galdor7(at)hotmail.com
> mboyer(at)westbrook.me.us
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
>

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