This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Stylesheets > February 2004 > Problem with visited links
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem with visited links
|
|
| Rickard Lindhé 2004-02-17, 7:29 pm |
| Hey.
I'm experiencing a problem using a css stylesheet on my homepage
(http://w1.193.telia.com/~u19305515/test/testis.html). As you can see, the
link works according to the stylesheet when not visited. But when the link
is visited, the stylesheet has no effect on the link. Basically, what my
problem is all about, is that I want my visited links to be underlined in
hover, just like they are when not visited.
I hope there is someone who can help me with this issue!
/Rickard
This is how my .css file looks like now:
A:active {
COLOR: #4040cc; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION:
underline
}
A:hover {
COLOR: #aa0050; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION:
underline
}
A:link {
COLOR: #4040cc; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
A:visited {
COLOR: #4040cc; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION: none
}
BODY {
COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt;
}
#PCL {
font-family: Verdana,Arial,Helvetica;
font-style: none;
font-weight: normal;
text-decoration: none;
font-size: 8pt;
}
#PTT {
font-family: Verdana,Arial,Helvetica;
font-size: 8pt;
}
#PST {
font-family: Verdana,Arial,Helvetica;
font-size: 8pt;
}
| |
|
| On Tue, 17 Feb 2004 23:21:35 GMT, Rickard Lindhé <rickardlindhe@telia.com>
wrote:
> A:active {
> COLOR: #4040cc; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION:
> underline
> }
> A:hover {
> COLOR: #aa0050; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION:
> underline
> }
> A:link {
> COLOR: #4040cc; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION:
> none
> }
> A:visited {
> COLOR: #4040cc; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION:
> none
> }
In addition to Steve's points, I'm wondering whether it's wise to
eliminate the underlining on these links. Sure, you dd it when someone
hovers, but how do you know it's there to hover over it? Seems to me these
links will be followed through dumb luck.
Perhaps your context makes it absolutely and unambiguously clear where the
links are without underlining, in which case never mind.
| |
|
|
| Jukka K. Korpela 2004-02-19, 3:28 am |
| Stan Brown <the_stan_brown@fastmail.fm> wrote:
>
> After which I put a[name] because some browsers (sorry, don't
> remember which) styles <a name="...">...</a> the same as links, and
> that cured it.
Mozilla?
> Seems strange that a browser smart enough to recognize an attribute
> selector would be dumb enough to think that <a name> is a link, but
> it happened.
Actually, if you use the selector :hover as such, or the selector
a:hover, then I'd say there's nothing foolish in making it match any
<a> element when hovered. Whether an <a> without href can be in the
pseudo-class :active is more questionable, but there's nothing in the
specs that prevents it.
So the safe approach is
:link { ... }
:visited { ... }
:link:hover, :visited:hover { ... }
:link:active, :visited:active { ... }
--
Yucca, http://www.cs.tut.fi/~jkorpela/
| |
| David Dorward 2004-02-19, 4:28 am |
| Stan Brown wrote:
> After which I put a[name] because some browsers (sorry, don't
> remember which) styles <a name="...">...</a> the same as links, and
> that cured it.
>
> Seems strange that a browser smart enough to recognize an attribute
> selector would be dumb enough to think that <a name> is a link, but
> it happened.
Such browsers don't think that <a name> is a link, and don't apply styles
using the a:link or a:visited selectors. They do apply the a:hover selector
because this says "An anchor that has the mouse over it" not "A link that
has the mouse over it".
--
David Dorward <http://dorward.me.uk/>
| |
| Safalra 2004-02-19, 7:29 am |
| "Rickard Lindhé" <rickardlindhe@telia.com> wrote in message news:<3mxYb.49392$mU6.195074@newsb.telia.net>...
> [snip]
> A:visited {
> COLOR: #4040cc; FONT-FAMILY: Tahoma; FONT-SIZE: 9pt; TEXT-DECORATION: none
> }
With a few exceptions, it's generally a bad idea to remove the
underline from links (even visited ones). See the second half ('Why
not to do it') of:
http://www.safalra.com/hypertext/ht...rlinelinks.html
--- Safalra (Stephen Morley) ---
http://www.safalra.com/hyerptext
| |
| Nick Theodorakis 2004-02-20, 1:28 am |
| On Wed, 18 Feb 2004 19:45:19 -0500, Stan Brown
<the_stan_brown@fastmail.fm> wrote:
>It seems "Steve Pugh" wrote in
>comp.infosystems.www.authoring.stylesheets:
>
>After which I put a[name] because some browsers (sorry, don't
>remember which) styles <a name="...">...</a> the same as links, and
>that cured it.
>
That would be Mozilla, as Jukka surmised. But you can also "cure" that
problem by keeping the attribute empty; e.g.:
<h2><a name="foo"></a>Bar</h2>
I've read several times that some (older?) browsers have trouble with
keeping the attribute empty, but it seems to work for me in every
browser I've tried, even NS4.
Nick
--
Nick Theodorakis
nick_theodorakis@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
| |
| Jukka K. Korpela 2004-02-20, 3:29 am |
| nick_theodorakis@hotmail.com (Nick Theodorakis) wrote:
> <h2><a name="foo"></a>Bar</h2>
>
> I've read several times that some (older?) browsers have trouble with
> keeping the attribute empty, but it seems to work for me in every
> browser I've tried, even NS4.
But this trick is not needed if you use suitable selectors, as
mentioned - and it is instructive to learn to use selectors properly.
Empty <a> elements used to confuse some rather early browsers (could
have been IE 2 or something), and much later some problems with quite
different browsers emerged. Instead of trying to trace back the history
and study the present and guess the future, I would just use the safe
and logical way.
Some people say that the logical way is to use just the id attribute,
and W3C policy says the same. And <h2 id="foo">Bar</h2> works fine on
most browsers, and avoids the problem discussed here. But
<h2><a name="foo">Bar</a></h2> is still somewhat safer.
There's a CSS-related reason to avoid empty <a> elements. Suppose an
author wishes to study a page (written by someone else, or maybe by
himself a year ago) to see the possible target anchors, in order to
know what locations inside the page can be "jumped into". Reading the
source code is one option, but it is more comfortable to authors who
use an advanced browser to set up a user style sheet that hightlights
a) all elements with id attributes
b) all a elements with name attributes
and what happens in b) when the element is empty?
(OK, this argument cheats a little. An advanced browser supports
:before and :after pseudoelements, too.)
--
Yucca, http://www.cs.tut.fi/~jkorpela/
| |
| Nick Theodorakis 2004-02-20, 11:29 pm |
| On Fri, 20 Feb 2004 07:16:03 +0000 (UTC), "Jukka K. Korpela"
<jkorpela@cs.tut.fi> wrote:
[...]
>Some people say that the logical way is to use just the id attribute,
>and W3C policy says the same. And <h2 id="foo">Bar</h2> works fine on
>most browsers, and avoids the problem discussed here.
I have started doing this on my personal site. I decided that the
number of NS4 users hitting my site is low enough that those still
using it have made a deliberate choice to do so and are aware of its
limitations.
Nick
--
Nick Theodorakis
nick_theodorakis@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
| |
| Stan Brown 2004-02-21, 11:29 am |
| It seems "Nick Theodorakis" wrote in
comp.infosystems.www.authoring.stylesheets:
>On Fri, 20 Feb 2004 07:16:03 +0000 (UTC), "Jukka K. Korpela"
><jkorpela@cs.tut.fi> wrote:
>
>I have started doing this on my personal site. I decided that the
>number of NS4 users hitting my site is low enough that those still
>using it have made a deliberate choice to do so and are aware of its
>limitations.
I have been thinking seriously about making this switch too, but I
don't know if I'm quite ready. On the hand, we're talking about only
1.1% of browsers having navigation fail[1]; on the other hand, 1% of
some hundreds of millions is a frightening number.
[1] <http://www.useit.com/alertbox/990418.html> and scroll down to
"Update 2003"
Anyone have more up-to-date and equally believable figures?
--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
| |
|
|
Stan Brown wrote:
> It seems "Nick Theodorakis" wrote in
> comp.infosystems.www.authoring.stylesheets:
>
>
>
> I have been thinking seriously about making this switch too, but I
> don't know if I'm quite ready. On the hand, we're talking about only
> 1.1% of browsers having navigation fail[1]; on the other hand, 1% of
> some hundreds of millions is a frightening number.
>
On the other hand, you may estimate how many of those "1% of some
hundreds of millions" is visiting your site? :-)
--
/Arne
| |
| Nick Theodorakis 2004-02-21, 3:29 pm |
| On Sat, 21 Feb 2004 09:43:04 -0500, Stan Brown
<the_stan_brown@fastmail.fm> wrote:
>It seems "Nick Theodorakis" wrote in
>comp.infosystems.www.authoring.stylesheets:
>
>I have been thinking seriously about making this switch too, but I
>don't know if I'm quite ready. On the hand, we're talking about only
>1.1% of browsers having navigation fail[1]; on the other hand, 1% of
>some hundreds of millions is a frightening number.
>
>[1] <http://www.useit.com/alertbox/990418.html> and scroll down to
>"Update 2003"
>
>Anyone have more up-to-date and equally believable figures?
Well, I was talking about my own logs, so the numbers are believable
to me insofar as how accurately browsers identify themselves. FWIW, in
February, my logs show that about 0.2% of non-spider user-agents call
themselves Netscape 4.something.
In any case, I was just using those links as a "table of contents" to
lead users farther down the page, if they choose to do so, so it's not
a fatal error if they can't use it.
Nick
--
Nick Theodorakis
nick_theodorakis@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
| |
| Stephen Poley 2004-02-21, 5:29 pm |
| On Sat, 21 Feb 2004 09:43:04 -0500, Stan Brown
<the_stan_brown@fastmail.fm> wrote:
>It seems "Nick Theodorakis" wrote in
>comp.infosystems.www.authoring.stylesheets:
>
>I have been thinking seriously about making this switch too, but I
>don't know if I'm quite ready. On the hand, we're talking about only
>1.1% of browsers having navigation fail[1]; on the other hand, 1% of
>some hundreds of millions is a frightening number.
>
>[1] <http://www.useit.com/alertbox/990418.html> and scroll down to
>"Update 2003"
>
>Anyone have more up-to-date and equally believable figures?
Just under 2% of my visitors (this month) have a browser which ignores
'@import' - presumably most of them are NN4 users.
--
Stephen Poley
http://www.xs4all.nl/~sbpoley/webmatters/
| |
| Stan Brown 2004-02-22, 9:29 am |
| It seems "Nick Theodorakis" wrote in
comp.infosystems.www.authoring.stylesheets:
>On Sat, 21 Feb 2004 09:43:04 -0500, Stan Brown
><the_stan_brown@fastmail.fm> wrote:
>
[use id= instead of separate <a name= ]
[color=darkred]
[says 1.1% Netscape 4.x as of a year ago][color=darkred]
[color=darkred]
>Well, I was talking about my own logs, so the numbers are believable
>to me insofar as how accurately browsers identify themselves. FWIW, in
>February, my logs show that about 0.2% of non-spider user-agents call
>themselves Netscape 4.something.
Interesting. Though you might have a different mix of users, that
seems like only the "lunatic fringe" are using Netscape 4. :-)
>In any case, I was just using those links as a "table of contents" to
>lead users farther down the page, if they choose to do so, so it's not
>a fatal error if they can't use it.
Hmm -- matter of taste and opinion. When I as a visitor click on a
link and nothing happens, I assume the site is badly written. I'm
not using Netscape 4, though.
--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
| |
|
|
|
| Stan Brown wrote:
>
> [use id= instead of separate <a name= ]
>
> [Netscape 4.x]
>
> When I as a visitor click on a link and nothing happens, I assume the
> site is badly written. I'm not using Netscape 4, though.
That is a big difference, I think. Consider how many sites are badly
authored, and think about how they might render in Netscape 4. I'd
imagine that N4 users must be used to things breaking on a regular basis.
--
Brian (remove "invalid" in my address to email me)
http://www.tsmchughs.com/
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|