Connecting Tech Pros Worldwide Help | Site Map

Prevent image from changing colour

Member
 
Join Date: Dec 2008
Posts: 80
#1: Sep 22 '09
I create a css that will make the text on my html page change colour when the mouse is on it but on the page when i roll over the mouse to an image that i link it also change colour how can i make the image not to change colour it should just be normal when roll over
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Sep 22 '09

re: Prevent image from changing colour


do the same for the image, only just don’t alter the color value.
Member
 
Join Date: Dec 2008
Posts: 80
#3: Sep 23 '09

re: Prevent image from changing colour


Thank for your reply can you just show me an example
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: Sep 23 '09

re: Prevent image from changing colour


do you have something I can build upon?
Member
 
Join Date: Dec 2008
Posts: 80
#5: Sep 28 '09

re: Prevent image from changing colour


this is my code below i image that i link also change colour when i roll over the mouse on it
Expand|Select|Wrap|Line Numbers
  1. <html >
  2. <head>
  3. <title>Untitled Document</title>
  4. <style type="text/css">
  5. a:link {
  6.     color: #999999;
  7.     text-decoration: none;
  8. }
  9. a:visited {
  10.     text-decoration: none;
  11.     color: #999999;
  12. }
  13. a:hover {
  14.     text-decoration: none;
  15.     color: #0099CC;
  16. }
  17. a:active {
  18.     text-decoration: none;
  19.     color: #999999;
  20. }
  21.  
  22. </style>
  23. </head>
  24.  
  25. <body>
  26. <p><a href="home.html">home</a></p>
  27. <p><a href="image.html"><img src="image/ban.jpg" /></a></p>
  28. </body>
  29. </html>
  30.  
  31.  
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#6: Sep 28 '09

re: Prevent image from changing colour


Just remove the border.
Member
 
Join Date: Dec 2008
Posts: 80
#7: Sep 28 '09

re: Prevent image from changing colour


I do understand there is no border in the code
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#8: Sep 29 '09

re: Prevent image from changing colour


Quote:

Originally Posted by simon2x1 View Post

I do understand there is no border in the code

not in your code…

images inside a link tend to have a border by default (i.e. browser default) to make them recognisable as a link. you need to explicitly set the border to 0.
Reply