473,624 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with visited links

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,H elvetica;
font-style: none;
font-weight: normal;
text-decoration: none;
font-size: 8pt;
}

#PTT {
font-family: Verdana,Arial,H elvetica;
font-size: 8pt;
}

#PST {
font-family: Verdana,Arial,H elvetica;
font-size: 8pt;
}

Jul 20 '05 #1
17 3862
"Rickard Lindhé" <ri***********@ telia.com> wrote:
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.
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
}


The last style defined takes precedence when more than one style of
equal specificity applies. When a link is both visited and hovered the
last defined style will be used, which in your case is :visited.

The preferred order is :link :visited :hover :active

BTW, points are print media units and really aren't much good for use
in screen stylesheets. Google for the many threads explaining why.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 20 '05 #2
On Tue, 17 Feb 2004 23:21:35 GMT, Rickard Lindhé <ri***********@ 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.
Jul 20 '05 #3
Quoth the raven named Rickard Lindhé:
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
}
Your sequence is wrong. It needs to be link, visited, hover, active.
"Las Vegas Has Animals."

BODY {
COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica; FONT-SIZE: 8pt;
}

#PCL {
font-family: Verdana,Arial,H elvetica;
font-style: none;
font-weight: normal;
text-decoration: none;
font-size: 8pt;
}

#PTT {
font-family: Verdana,Arial,H elvetica;
font-size: 8pt;
}

#PST {
font-family: Verdana,Arial,H elvetica;
font-size: 8pt;
}


Please read any of the other dozens of threads that tell you Verdana
is a Bad Idea™ and to assign font-size: 100%
http://www.xs4all.nl/~sbpoley/webmatters/verdana.html

Oh, you do not need to repeat the font-family in every style. Just
place it once in the body {}. The C of CSS is Cascading.

--
-bts
-This space intentionally left blank.
Jul 20 '05 #4
It seems "Steve Pugh" wrote in
comp.infosystem s.www.authoring.stylesheets:
The preferred order is :link :visited :hover :active


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.

--
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/
Jul 20 '05 #5
Stan Brown <th************ @fastmail.fm> wrote:
The preferred order is :link :visited :hover :active
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/
Jul 20 '05 #6
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/>
Jul 20 '05 #7
"Rickard Lindhé" <ri***********@ telia.com> wrote in message news:<3m******* *************@n ewsb.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/htm...linelinks.html

--- Safalra (Stephen Morley) ---
http://www.safalra.com/hyerptext
Jul 20 '05 #8
On Wed, 18 Feb 2004 19:45:19 -0500, Stan Brown
<th************ @fastmail.fm> wrote:
It seems "Steve Pugh" wrote in
comp.infosyste ms.www.authoring.stylesheets:
The preferred order is :link :visited :hover :active


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
ni************* *@hotmail.com
nicholas_theodo rakis [at] urmc [dot] rochester [dot] edu
Jul 20 '05 #9
ni************* *@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/
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
10734
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand where they have been. I also agree to the background: Too many web authors keep uniform link colors or their pages, thereby confusing the users. What I have a hard time agreeing to is his conclusion that web authors should deliberately change the...
6
1470
by: - jes | last post by:
Greetings. Using CSS, a programmer can set the color for an href link and a different color for a VISITED href link. Anyone know where this "list" of visited links is stored? Is it accessible (can I read it) with ASP? Is it updateable (can I add new links to the list) with ASP?
1
1346
by: Chad | last post by:
First visit all of the links on the page. For each, if the link opens a new window, close it. If it opnes in teh same window, hit back. then hit REFRESH. Notice that while all links SHOULd be displayed in the visited color, usually not ALL of the links that open in a new window (the first 4) will appear as visited. The links that open in the same window will always appear as visited.
2
2094
by: george.leithead | last post by:
Hi all, I have a very strange problem! In following Web page (which is generated from a CMS System), the navigation to the left 'dissapears' when you roll the mouse over the links? It does not do this in all browsers either. I have found it to happen in IE 7 and the latest patched IE 6. I have tried to find out the reason, but keep finding strange behaviour! You will see at the bottom of the HTML, I have a comment. If you follow...
0
1418
by: PsyBorg | last post by:
This is not entirely a PHP question although it is based in PHP. I have been creating a site, where I want the visitors to see the visited links as "Crossed Out" using CSS. However, I also want this effect to disappear after about 18 hours, so I used a PHP cookie to read when the last time the user visited the site was, and change the CSS so that the "visited" links had the same "Style" as the regular links. This seemed to work, however...
8
11248
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField HeaderText="Subject" Text="Subject" DataTextField="Subject" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/Templates/View.aspx?id={0}" HeaderStyle-CssClass="columnStyle" ItemStyle-CssClass="columnStyle" />
27
2447
by: Corey Walker | last post by:
Hello: I developed a nice looking web page which provided people with a brief overview of our society's publications (our different newsletters). However, while I'm by no means an expert or professional website designer, I know enough about XHTML 1.0 to know that the best way to guarantee interoperability on all, or at least most browsers, including lynx is to make sure my site complies with the w3 standards. So, I ran my site through...
1
4105
beacon
by: beacon | last post by:
I'm looking to reset the visited link color once another link is selected. Also, once that link takes me to a particular page, I want the font-weight for that page to be bold to indicate that it's the page you're looking at. Now, if the links have never been visited before, they are blue. If you hover over the links they turn light blue. I want the user to be able to select the link and it take you to that page. On that page, I want the link...
3
2013
by: Steve | last post by:
Hi All I have an asp.net 2.0 website with the following css file It uses Master pages and in Firefox 3.04 for windows only, 3 of the web pages don't display the Master page properly The content page overlaps the Master page boundaries In IE 6/7 All works fine
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8677
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8620
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.