473,394 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Change Visited Link Colour of an Image

Hello all,

I'm using a website creation tool (called `rest2web
<http://www.voidspace.org.uk/python/rest2web/>`_) that lets me store my
content in a text based format ( `ReStructuredText
<http://docutils.sf.net>`_ and inserts the *generated* HTML into a
template.

When it creates the HTML for an image which is also a link, it
generates the following :

<a class="reference image-reference"
href="images/screenshot_big.jpg"><div align="center"
class="align-center"><img alt="Building with rest2web" class="image
align-center" src="images/screenshot.jpg" style="width: 410px; height:
308px;" /></div></a>

Once the link the image points to has been visited, the image acquires
an ugly purple border.

I'd like to change that, so I tried the following CSS (with umpteen
permutations). Firefox steadfastly ignored my efforts :

..image-reference a:visited {
text-decoration: none
border-colour: black;
}

Any hints ? Which class should I style to have the desired effect ?

Below are the other CSS rules in play, in case any are overriding :
img.align-center {
display: block;
margin: auto;
text-align: center;
}
img {
border:0;
}
I think that's it.

TIA

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

Apr 1 '06 #1
3 4105
Fuzzyman wrote:
Hello all,

I'm using a website creation tool (called `rest2web
<http://www.voidspace.org.uk/python/rest2web/>`_) that lets me store my
content in a text based format ( `ReStructuredText
<http://docutils.sf.net>`_ and inserts the *generated* HTML into a
template.

When it creates the HTML for an image which is also a link, it
generates the following :

<a class="reference image-reference"
href="images/screenshot_big.jpg"><div align="center"
class="align-center"><img alt="Building with rest2web" class="image
align-center" src="images/screenshot.jpg" style="width: 410px; height:
308px;" /></div></a>

Once the link the image points to has been visited, the image acquires
an ugly purple border.

I'd like to change that, so I tried the following CSS (with umpteen
permutations). Firefox steadfastly ignored my efforts :

.image-reference a:visited {
text-decoration: none
border-colour: black;
}

Any hints ? Which class should I style to have the desired effect ?

Below are the other CSS rules in play, in case any are overriding :
img.align-center {
display: block;
margin: auto;
text-align: center;
}
img {
border:0;
}
I think that's it.

TIA

Fuzzyman

Apart from the somewhat unorthodox placement/over-use of divs and
classes (which is perhaps expected when using autogenerated html, but
better be avoided in general) you made some mistakes.

You created a style for every <a> following a class image-reference.
What you want to do is create a style for <a> _having_ the class
image-reference. The pseudo-class :visited can simply be appended. Then
you forgot a ; after the first property and used colour (English) where
you should have used color (US-English).
You tried to set a border property for a link (<a>) and you should have
used color instead.

So a style rewrite for your example:

<style>
a.image-reference:visited {
text-decoration : none; /* not required here */
color : black;
}
</style>

Hope this helps,
Sh.

Apr 1 '06 #2

Schraalhans Keukenmeester wrote:
Fuzzyman wrote: [snip..] Apart from the somewhat unorthodox placement/over-use of divs and
classes (which is perhaps expected when using autogenerated html, but
better be avoided in general) you made some mistakes.

You created a style for every <a> following a class image-reference.
What you want to do is create a style for <a> _having_ the class
image-reference. The pseudo-class :visited can simply be appended. Then
you forgot a ; after the first property and used colour (English) where
you should have used color (US-English).
You tried to set a border property for a link (<a>) and you should have
used color instead.

So a style rewrite for your example:

<style>
a.image-reference:visited {
text-decoration : none; /* not required here */
color : black;
}
</style>

Hope this helps,
Thanks very much for your explanation and fix. It works like a charm.

Much Appreciated.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
Sh.


Apr 1 '06 #3

Schraalhans Keukenmeester wrote:
[snip..]
Apart from the somewhat unorthodox placement/over-use of divs and
classes (which is perhaps expected when using autogenerated html, but
better be avoided in general) you made some mistakes.

You created a style for every <a> following a class image-reference.
What you want to do is create a style for <a> _having_ the class
image-reference. The pseudo-class :visited can simply be appended. Then
you forgot a ; after the first property and used colour (English) where
you should have used color (US-English).
You tried to set a border property for a link (<a>) and you should have
used color instead.

So a style rewrite for your example:

<style>
a.image-reference:visited {
text-decoration : none; /* not required here */
color : black;
}
</style>

Hmmm... actually this works for Firedox, but not IE. :-(

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
Hope this helps,
Sh.


Apr 1 '06 #4

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

Similar topics

9
by: Matt Adams | last post by:
As well known I could specify the text color in the body tag like: <BODY TEXT=WHITE LINK=WHITE VLINK=RED ALINK=WHITE> What I want to achieve now is that always (!) the text of the last visited...
12
by: jfburr | last post by:
very simple thing (I hope) I've got a css style sheet that starts like this: ______________ A:link { color: cc9933; }
18
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...
3
by: bigoxygen | last post by:
Hi. I have a list that is similar to this: -Evaluation +test +test -Students +test I would like to change the "-" bullet only, but I cannot. My
3
by: Mike Barnard | last post by:
Hi all, newbie here. Odd sounding subject but I can't describe it any better. I'm trying to teach myself a little about CSS. In a test site (not published) I am trying to use CSS to make...
2
by: chris_culley | last post by:
Hi there, I've got a gif with (highly) irregular shapes (lots of jigsaw pieces) that I want to map so that each piece is a link... The pieces are currently just a frame drawing, but as they...
4
by: sgxbytes | last post by:
Hi, My html has <Table style="year-button-archive" width="60%" > <tr> <td class="gold" > <a title="year">By Year:</a> <td class="gold"> <a id = "2008"...
3
by: reyo | last post by:
Hi, i design a dynamic web page.infact it will be a css generator. i have a question about visited link. i want to change color,font-size,font-weight etc. of a link when it is visited. when a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.