Forum Moderators: not2easy

Message Too Old, No Replies

New to CSS and need help with A: and Img:

Newbie at CSS.

         

theaverageidiot

8:45 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



Hello!

I'm new to CSS. Newer than new. I'm not even hatched yet :P. My question is simple...

<STYLE TYPE='text/css'>
A{color:#FF0000; }
A:Visited{color:#FF0000; }
A:Hover{color:#00FF00; }
Img{}
Img:Visited{}
Img:Hover{}
</STYLE>

What I'm attemping is to make A tags have hovers and stuff. But, I don't want A tags wrapped around images to make the image have hovers.

But that code doesn't work. What's the solution?

Thanks!

ChadSEO

9:21 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



theaverageidiot,

Welcome to WebmasterWorld!

If you want linked images to have a red border all the time, you can do this:

<STYLE TYPE='text/css'>
A{color:#FF0000; }
A:Visited{color:#FF0000; }
A:Hover{color:#00FF00; }
a img { border:1px solid #FF0000;}
</STYLE>

If you don't want them to have a border at all, then use this:

<STYLE TYPE='text/css'>
A{color:#FF0000; }
A:Visited{color:#FF0000; }
A:Hover{color:#00FF00; }
a img { border:0;}
</STYLE>

Chad

theaverageidiot

10:03 pm on Mar 29, 2006 (gmt 0)

10+ Year Member



Perfect! Thank you very much!