Topic: A:visited Disappearing Underline Weirdness (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=10767" title="Pages that link to Topic: A:visited Disappearing Underline Weirdness (Page 1 of 1)" rel="nofollow" >Topic: A:visited Disappearing Underline Weirdness <span class="small">(Page 1 of 1)</span>\

 
brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 07-02-2002 05:21

I'm having trouble figuring out why this is happening and how to fix it. What am I missing here?

I have a table-based layout where in two TD classes I want no underlining of the links. In one of them, (.menu) I also want them display: block. All the rest of the links should be underlined and all links reverse on hover.

The problem is that on the entire page, all TD classes, all links, on A:visited the underline disappears. (Tested in Windows versions of Mozilla 1, Netscape 6 & 7, IE 5.01, 5.5, 6; Opera 5.12, 6.03; Mac not yet tested.)

XHTML validates, CSS validates (except on index page where for some weird reason the CSS validator chokes on an <li> tag that looks fine to me and to the XHTML validator.)

Clue that I don't quite follow: CSS validator flags this warning: "Line : 26 Level : 2 Redefinition of text-decoration : A:visited" which corresponds to the bolded line below.


CSS in stylesheet 1, <link>ed"

A:link, A:visited, A:active {
color: #555522;
background-color: transparent;
text-decoration: underline;}


CSS in stylesheet 2, @imported:

A {
padding: 0 2px;}

A:hover {
color: #ffffdd;
background-color: #555522;
text-decoration: none;}

TD.horznav A:link, A:visited, A:active {
text-decoration: none;}

TD.menu A {
display: block;
text-decoration: none;}


By my understanding, the bolded line above should apply ONLY to links within the TD.horznav cells, not the entire freakin' page. What am I missing?


"the most incredible feats are often accomplished by
those who have had the most incredible challenges"

[This message has been edited by brucew (edited 07-03-2002).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 07-02-2002 05:43

No, the comma has a higher precedence than a space. So

TD.horznav A:link, A:visited, A:active

is interpreted as

(TD.horznav A:link), A:visited, A:active

rather than

TD.horznav (A:link, A:visited, A:active)

As you're expecting. (Note: Parenthesis don't really work in CSS, i'm just using them for explanation.)

So you'll have to explicitly say

TD.horznav A:link, TD.horznav A:visited, TD.horznav A:active

[edit: or just "TD.horznav A {...}" since you're applying it to all anchor tags anyway.]

[This message has been edited by Slime (edited 07-02-2002).]

brucew
Paranoid (IV) Inmate

From: North Coast of America
Insane since: Dec 2001

posted posted 07-02-2002 13:45

Thanks Slime!

I knew it was something I wasn't understanding. The optional extra-thick skull is useful in car crashes, but not when it comes to things like this.

"the most incredible feats are often accomplished by
those who have had the most incredible challenges"



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu