Forum Moderators: not2easy

Message Too Old, No Replies

Need Help: IE6 is troubling me, CSS a href IMG color

css img tag inside of an a href tag color

         

npiamaio

7:35 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



Hello all,
I'm having trouble with IE6 and CSS. I'm trying to do a relatively simple thing. I can't make IE6 behave as I want it to. I am trying to set the color of a link containing an image, i.e. the color surrounding the image. I'd like to make the link color the same as the background color. I'm successful in Netscape 7, Opera 7.23 and Mozilla Firefox 0.8 but can't do it in IE6. I'm using the following CSS code that I had in test.css and the following html code. Could someone help? Is there a known workaround for this? Do I have to treat IE6 special in this case? I’ve been trying many different things and my patience is being stretched.

/* begin css */
body { background-color: #FEF8D6; }

A:link { color: blue }
A:visited { color: purple }
A:active { color: red }
A:hover { background-color:white }

a img{ color: #FEF8D6 }

/* end of css */

Here is the HTML...

<html>
<head>
<link rel="stylesheet" type="text/css" href="test.css">
</head>

<body>

<a href="afile.html">SomeText</a> The Link
<a href="afile.pdf">PDF</a>
<br>
<a href="afile.html">SomeText</a> The Link
<a href="afile.pdf"><img src="http://www.adobe.com/images/get_adobe_reader.gif"></a>
</body>
</html>

RammsteinNicCage

8:13 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



Do you want to set it the same as the surrounding color so that it looks like there isn't a link border there? If so, give your image a border equal to zero and it will give you the same effect. If that isn't it, try changing the border color for the image.

Jennifer

npiamaio

10:17 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



Jennifer,
Thanks, your suggestion works. The 0 border width wasn't exactly what I was shooting for but it will get the job done. Thanks for your help. I made my images have a border of 0 and IE can render that correctly.

I was trying to make IE display the border like all the other browsers. I should be able to chose the color of the border surrounding the image that I chose for a link. I guess this is a limitation of IE6.

Thanks again

-Nate

npiamaio

10:24 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



Jennifer,
I was setting the color parameter rather than the border-color parameter.

My css becomes:

body
{
background-color: #FEF8D6;
}

A:link { color: blue } /* unvisited link */
A:visited { color: purple } /* visited links */
A:active { color: red } /* active links */
A:hover { background-color:white } /* hover links */

a img{
/*color: #FEF8D6;*/
border-color: #FEF8D6
}

a:hover img{
border-color: #669966
}

It’s obvious now.

Thanks for you help,
-Nate

RammsteinNicCage

11:09 pm on Mar 20, 2004 (gmt 0)

10+ Year Member



No problem, glad it worked. :)

Jennifer