Border color on linked graphics / CSS ?

S

still me

I am setting the link colors using CSS in a style file, e.g.:

a:link{color:#999999}
a:visited{color:#999999}
a:hover{color:#999999}
a:active{color:#999999}

All the normal text links pick up the color.However, the border on
linked images doesn't pick up the color.

How can I specify a link color for linked images with borders via CSS
?

Thanks,
 
R

rf

still me said:
I am setting the link colors using CSS in a style file, e.g.:

a:link{color:#999999}
a:visited{color:#999999}
a:hover{color:#999999}
a:active{color:#999999}

You should not set all those things to the same colour.
All the normal text links pick up the color.However, the border on
linked images doesn't pick up the color.

How can I specify a link color for linked images with borders via CSS

a:link img {color ...
..
..
..
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Tue, 14 Aug 2007 04:56:28 GMT
still me scribed:
I am setting the link colors using CSS in a style file, e.g.:

a:link{color:#999999}
a:visited{color:#999999}
a:hover{color:#999999}
a:active{color:#999999}

All the normal text links pick up the color.However, the border on
linked images doesn't pick up the color.

How can I specify a link color for linked images with borders via CSS
?

Thanks,

Specify a border for images such as:

img { border:4px solid; }
 
J

Jukka K. Korpela

Scripsit still me:
I am setting the link colors using CSS in a style file, e.g.:

a:link{color:#999999}
a:visited{color:#999999}
a:hover{color:#999999}
a:active{color:#999999}

That's grossly wrong. Read a decent tutorial on web design to see why.
Briefly, links want to be links, and they want to look different after being
visited, and when hovered, and perhaps even when activated. They do all this
nicely on common browsers by default, so why do you attack this
functionality?
All the normal text links pick up the color.

Sadly enough. And they may pick the same, or very similar, color as
background - you created this risk.
How can I specify a link color for linked images with borders via CSS
?

You set a border for an image by setting border properties for an <img>
element.

For example,

:link img { color: #0000af; background: white; }
:visited img { color: #609; background: white; }
:link:hover img, :visited:hover img { color: #c33; background: white; }

On the other hand, if an image is relevant to the content, it should not be
messed up by making it a link. If it is just decoration, it surely shouldn't
be a link.

In special cases, it might make sense to make an image and its caption a
link, just because people may assume that they can click on the image, too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top