HighDots Forums  

Change Visited Link Colour of an Image

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Change Visited Link Colour of an Image in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fuzzyman
 
Posts: n/a

Default Change Visited Link Colour of an Image - 04-01-2006 , 08:08 AM






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


Reply With Quote
  #2  
Old   
Schraalhans Keukenmeester
 
Posts: n/a

Default Re: Change Visited Link Colour of an Image - 04-01-2006 , 08:46 AM






Fuzzyman wrote:
Quote:
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.





Reply With Quote
  #3  
Old   
Fuzzyman
 
Posts: n/a

Default Re: Change Visited Link Colour of an Image - 04-01-2006 , 09:04 AM




Schraalhans Keukenmeester wrote:
Quote:
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

Quote:
Sh.


Reply With Quote
  #4  
Old   
Fuzzyman
 
Posts: n/a

Default Re: Change Visited Link Colour of an Image - 04-01-2006 , 01:23 PM




Schraalhans Keukenmeester wrote:
[snip..]
Quote:
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

Quote:
Hope this helps,
Sh.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.