When I use an image to link to another image, the second image looses the background color. How do I keep it?

Here's the code: <HTML> <HEAD> <TITLE></TITLE> </HEAD> <BODY bgcolor="#FF0000"> <A HREF="XXXXXXXXX"><IMG SRC="YYYYYYYYY"></A> </BODY> </HTML> X looses the red background.

Public Comments

  1. Is the second image made of CSS or something?
  2. Try a little css in the head section to define the background color of the link like this... <style type="text/css"> a:link, a:active, a:visited, a:hover, a:focus {background:#ff0000} </style>
  3. If you are linking directly to a picture, that picture becomes your new page; it doesn't inherit the properties of the page you linked to it from. You need to either put the second picture on its own page with a background color, or put the pictures in an iframe on your original page.
Powered by Yahoo! Answers