CSS img help

From Basic to Advanced HTML and CSS

CSS img help

Postby Verbitan » Sun Mar 04, 2007 6:47 pm

Basically i have a css command so that when you hover over an image on my page it will be obvious. Dont really know how to explain it...look at the code and see! :p

Code: Select all
<style>
img {
   border: 0;
   filter:alpha(opacity=80);
   -moz-opacity: 0.80;
   opacity: 0.80;
}

   img:hover{
      filter:alpha(opacity=95);
      -moz-opacity: 0.95;
      opacity: 0.95;
   }

</style>


The prob is that this code overwrites EVERY image on my page. This is fine...but i want one image to be exempt from this rule. Any ideas how to do that?
Image
"Good luck, Mr Gorsky" - Neil Armstrong
User avatar
Verbitan
Site Admin
Site Admin
 
Posts: 749
Joined: Mon Apr 12, 2004 10:59 am
Location: Horley, UK

Postby Boyd » Mon Mar 05, 2007 12:08 pm

use a class name instead mate, let's change the "img" to "photoframe" for example

Code: Select all
<style>
.photoframe {
   border: 0;
   filter:alpha(opacity=80);
   -moz-opacity: 0.80;
   opacity: 0.80;
}

   .photoframe:hover {
      filter:alpha(opacity=95);
      -moz-opacity: 0.95;
      opacity: 0.95;
   }

</style>


so, you use it as

Code: Select all
<img class="photoframe" src="http://xxx.xxx.xxx">


OK?
MOBO ::: ATI Radeon Xpress 200 (RS480) - A58K9-MLF
CPU ::: AMD 64 X2 4400+ Clawhammer Dual Core
RAM ::: 4 x QDI 512MB DDR400
VGA ::: ATI X4850 512MB PCI-e
User avatar
Boyd
Site Admin
Site Admin
 
Posts: 1647
Joined: Tue Mar 16, 2004 1:00 am
Location: London, UK

Postby Verbitan » Mon Mar 05, 2007 5:22 pm

Aaah thanks! I will give that a go tonight! :D
Image
"Good luck, Mr Gorsky" - Neil Armstrong
User avatar
Verbitan
Site Admin
Site Admin
 
Posts: 749
Joined: Mon Apr 12, 2004 10:59 am
Location: Horley, UK


Return to HTML / CSS

Who is online

Users browsing this forum: No registered users and 1 guest

cron