IMG Opacity - CSS
4 posters
Page 1 of 1
IMG Opacity - CSS
Okay, so I've been trying to add opacity to all images with links. When I say 'with links' I mean images that have a link if you click the image.
I've tried this code, but it did not work
I know this code below works, but it just does every single image, link or not.
I've tried this code, but it did not work
- Code:
img a {
opacity: 1.00;
}
img a:hover {
opacity: 0.80;
}
I know this code below works, but it just does every single image, link or not.
- Code:
img {
opacity: 1.00;
}
img:hover {
opacity: 0.80;
}
Last edited by !_NICK_! on December 2nd 2012, 7:01 pm; edited 1 time in total
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
Re: IMG Opacity - CSS
- Code:
a.mainmenu{
filter:alpha(opacity=100);
-moz-opacity: 1.;
opacity: 1.0;
}
a.mainmenu:hover{
filter:alpha(opacity=90);
-moz-opacity: 0.65;
opacity: .50;
}
a:hover{ opacity:0.65; -moz-opacity: 0.65; filter: alpha(opacity=65); }
a:hover{
text-decoration: none !important;
}
a{
text-decoration: none !important;
}
The code above works for anything that has a href/url codes or do you want just the one with the images only?
Re: IMG Opacity - CSS
Next time post the url for your forum.
I've edited your code a bit, you might not be using the right browser. Try this instead.
I've edited your code a bit, you might not be using the right browser. Try this instead.
- Code:
img a {
opacity: .5;
-o-opacity: .5;
-moz-opacity: .5;
-webkit-opacity: .5;
}
img a:hover {
opacity: 1;
-o-opacity: 1;
-moz-opacity: 1;
-webkit-opacity: ;
}
Re: IMG Opacity - CSS
Well you can't have an anchor tag inside of an IMG tag since there is no closing IMG tag. The IMG tag is inside the anchor tag.
So the selectors would be:
a img { styling... }
a img:hover { styling... }
That tackles all images inside links.
So the selectors would be:
a img { styling... }
a img:hover { styling... }
That tackles all images inside links.
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: IMG Opacity - CSS
@Kaizer Lee - That really isn't what I wanted. I just wanted the images.
@Dex♥ - There is no reason to post my forum url.
@LGforum - I love to read your work and tutorials. This really does make since now that I think about it. Thanks LGforum!
Solved, thanks to LGforum!
@Dex♥ - There is no reason to post my forum url.
@LGforum - I love to read your work and tutorials. This really does make since now that I think about it. Thanks LGforum!
Solved, thanks to LGforum!
!_NICK_!- Active Poster
- Posts : 1505
Reputation : 69
Language : English, HTML, and CSS
Location : In the middle of no return.
Similar topics
» Low opacity and higher opacity when mouse hover
» body opacity
» Opacity for Background 1 and 2
» Opacity of element
» Banner opacity style ?
» body opacity
» Opacity for Background 1 and 2
» Opacity of element
» Banner opacity style ?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum