Reputation: 43
I have tried searching for this but cannot find it. I have created a class which when hovered over the pararaph element zooms in and decreases opacity. I have use a transition on this of (.5s). This works really well. However I have seen (I watched a video) that you can create a transition for after the hover. I have been trying to use:
image:hover:after p {
transition: .5s;
}
But it is not working. I do not understand these webkit options. And I have seen this done without the use of webkit. Basically, is it possible without webkit? Or is it my imagination?
If webkit is the only way could someone link me to some AWESOME tutorials.
This is what I currently have in my stylesheet :
.image p {
color: black;
font-weight: bold;
background: rgba(235, 229, 235, .3);
}
.image:hover p {
background: rgba(235, 229, 235, .9);
transition: 0.5s;
font-size: 110%;
}
Thanks,
Luke
Upvotes: 0
Views: 5838
Reputation: 9
.image p a {
-webkit-transition: all 2s ease-in-out;
-moz-transition: all 2s ease-in-out;
-ms-transition: all 2s ease-in-out;
-o-transition: all 2s ease-in-out;
transition: all 2s ease-in-out;
}
.image p a:hover {
-webkit-opacity: 0.25;
-moz-opacity: 0.25;
opacity: 0.25;
}
<div class="image">
<p><a>fade in fade out effect on hover element</a> </p>
</div>
Upvotes: 1
Reputation: 1091
Try moving the transition
property to the normal selector not the hover; Otherwise the transition effect will only applied when you're hovered over not moused out..
e.g.
.image p {
color: black;
font-weight: bold;
background: rgba(235, 229, 235, .3);
transition: 0.5s;
}
.image:hover p {
background: rgba(235, 229, 235, .9);
font-size: 110%;
}
Upvotes: 0