PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.CSS > Strange(?) behavior with styled links
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Strange(?) behavior with styled links

Réponse
 
LinkBack Outils de la discussion
Vieux 29/03/2008, 18h51   #1
Ed Jay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Strange(?) behavior with styled links

I have a menu with selections:
<a class="nav4w" href="foo.html">buttontext&nbsp;</a>

Styled in an external style sheet as:

..nav4w {
padding:2px 0 3px 0;
display:block;
width:98%;
border-bottom:1px solid #300099;
margin-top:1px;
text-align:right;
text-decoration:none;
font-family: Arial, Helvetica, sans-serif;font-size:100%;
font-weight:normal;
overflow:hidden;
}

a.nav4w:link {color:#f8fafc;}
a.nav4w:hover {color:#330099;background-color:#f8fafc;}
a.nav4w:visited {color:#ffff00;} /*background-color:#3c93db;*/
a.nav4w:active {color:#ffffff;}

If I specify a background-color for the visited link, it doesn't change on
hover. Is this normal, or what am I doing wrong?

TIA,
--
Ed Jay (remove 'M' to respond by email)
  Réponse avec citation
Vieux 29/03/2008, 19h02   #2
Beauregard T. Shagnasty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange(?) behavior with styled links

Ed Jay wrote:

> a.nav4w:link {color:#f8fafc;}
> a.nav4w:hover {color:#330099;background-color:#f8fafc;}
> a.nav4w:visited {color:#ffff00;} /*background-color:#3c93db;*/
> a.nav4w:active {color:#ffffff;}
>
> If I specify a background-color for the visited link, it doesn't
> change on hover. Is this normal, or what am I doing wrong?


You have the order wrong above. Needs to be:
link, visited, (focus,) hover, active

--
-bts
-"Las Vegas Has Animals"
  Réponse avec citation
Vieux 29/03/2008, 19h27   #3
Ed Jay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange(?) behavior with styled links

Beauregard T. Shagnasty scribed:

>Ed Jay wrote:
>
>> a.nav4w:link {color:#f8fafc;}
>> a.nav4w:hover {color:#330099;background-color:#f8fafc;}
>> a.nav4w:visited {color:#ffff00;} /*background-color:#3c93db;*/
>> a.nav4w:active {color:#ffffff;}
>>
>> If I specify a background-color for the visited link, it doesn't
>> change on hover. Is this normal, or what am I doing wrong?

>
>You have the order wrong above. Needs to be:
>link, visited, (focus,) hover, active


Thank you...
--
Ed Jay (remove 'M' to respond by email)
  Réponse avec citation
Vieux 30/03/2008, 08h55   #4
Molly Mockford
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange(?) behavior with styled links

At 11:27:16 on Sat, 29 Mar 2008, Ed Jay <edMbj@aes-intl.com> wrote in
<gf2tu3le195mqu0l9ih375mti3sip5ppfr@4ax.com>:

>Beauregard T. Shagnasty scribed:
>
>>Ed Jay wrote:
>>
>>> a.nav4w:link {color:#f8fafc;}
>>> a.nav4w:hover {color:#330099;background-color:#f8fafc;}
>>> a.nav4w:visited {color:#ffff00;} /*background-color:#3c93db;*/
>>> a.nav4w:active {color:#ffffff;}


>>You have the order wrong above. Needs to be:
>>link, visited, (focus,) hover, active

>
>Thank you...


A useful mnemonic to use in the future is Little Virgins Have Arses.
(For a while I tried suggesting Little Virgins Have Arms, but the former
proved the more memorable ... for some strange reason...!)
--
Molly Mockford
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety - Benjamin Franklin
(My Reply-To address *is* valid, though may not remain so for ever.)
  Réponse avec citation
Vieux 30/03/2008, 09h30   #5
VK
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange(?) behavior with styled links

On Mar 30, 11:55 am, Molly Mockford <nospamnob...@mollymockford.me.uk>
wrote:
> At 11:27:16 on Sat, 29 Mar 2008, Ed Jay <ed...@aes-intl.com> wrote in
> <gf2tu3le195mqu0l9ih375mti3sip5p...@4ax.com>:
>
> >Beauregard T. Shagnasty scribed:

>
> >>Ed Jay wrote:

>
> >>> a.nav4w:link {color:#f8fafc;}
> >>> a.nav4w:hover {color:#330099;background-color:#f8fafc;}
> >>> a.nav4w:visited {color:#ffff00;} /*background-color:#3c93db;*/
> >>> a.nav4w:active {color:#ffffff;}
> >>You have the order wrong above. Needs to be:
> >>link, visited, (focus,) hover, active

>
> >Thank you...

>
> A useful mnemonic to use in the future is Little Virgins Have Arses.
> (For a while I tried suggesting Little Virgins Have Arms, but the former
> proved the more memorable ... for some strange reason...!)


A better solution yet would be to explain the actual CSS rules
priority for links so to use either preferred way out of many to keep
the right priority. Otherwise all these "right orders" and "little
virgins" brings way too much of voodooism into styling. Just like
someone would making "Be Red" and "Rise Blue" slogans to memorize the
div order below for a particular color instead of understanding the
CSS rule override mechanics :-)
div {
color: blue;
}
div {
color: red;
}

The topic in question was once explained in details at
http://groups.google.com/group/comp....063946e8b87860

  Réponse avec citation
Vieux 30/03/2008, 14h19   #6
Rob Waaijenberg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange(?) behavior with styled links

Beauregard T. Shagnasty vertrouwde ons toe:
> Ed Jay wrote:
>
>> a.nav4w:link {color:#f8fafc;}
>> a.nav4w:hover {color:#330099;background-color:#f8fafc;}
>> a.nav4w:visited {color:#ffff00;} /*background-color:#3c93db;*/
>> a.nav4w:active {color:#ffffff;}
>>
>> If I specify a background-color for the visited link, it doesn't
>> change on hover. Is this normal, or what am I doing wrong?

>
> You have the order wrong above. Needs to be:
> link, visited, (focus,) hover, active
>


Not according to Eric Meyer

http://meyerweb.com/eric/thoughts/20...e-link-states/

--
Rob
  Réponse avec citation
Vieux 30/03/2008, 14h29   #7
Gus Richter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange(?) behavior with styled links

VK wrote:
>
> A better solution yet would be to explain ............


<http://meyerweb.com/eric/css/link-specificity.html>

--
Gus
  Réponse avec citation
Vieux 30/03/2008, 14h29   #8
Beauregard T. Shagnasty
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strange(?) behavior with styled links

Rob Waaijenberg wrote:

> Beauregard T. Shagnasty vertrouwde ons toe:
>> Ed Jay wrote:
>>
>>> a.nav4w:link {color:#f8fafc;}
>>> a.nav4w:hover {color:#330099;background-color:#f8fafc;}
>>> a.nav4w:visited {color:#ffff00;} /*background-color:#3c93db;*/
>>> a.nav4w:active {color:#ffffff;}
>>>
>>> If I specify a background-color for the visited link, it doesn't
>>> change on hover. Is this normal, or what am I doing wrong?

>>
>> You have the order wrong above. Needs to be:
>> link, visited, (focus,) hover, active

>
> Not according to Eric Meyer
>
> http://meyerweb.com/eric/thoughts/20...e-link-states/


Note that the content and comments on this linked page are at odds.
Looks like about half of the respondents favor :focus after :hover, and
the other half prefer it before.

http://meyerweb.com/eric/thoughts/20...e-link-states/

"¡§:link, :visited, :focus, :hover, :active¡¨ should be the most useful
way [¡K]."

"I remember reading something a few years ago that used this piece of
wisdom to remember the order:
[L]uther [V]andross [F]ans [H]ate [A]bba.

Brilliant."

"I¡¦m with Jens. My favourite rule is ¡§Lord Vader¡¦s Former Handle
Anakin¡¨."

For :focus, it probably doesn't matter very much, as long as
link, visited, hover, active
are in this order.

--
-bts
-Friends don't let friends drive Vista
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16465 seconds with 16 queries