Tagged: x
-
AuthorPosts
-
January 5, 2017 at 2:48 pm #1317835
850itParticipantHow can I make a CTA with an image as a background?
Also is it possible to change it for another one on the mouse hover?Thanks
January 5, 2017 at 3:24 pm #1317879
JadeModeratorHi There,
Thanks for writing in! assign a unique CLASS for each of your CTA element.
And then update your code to this.
a.myclass { background-image: url('BACKGROUND IMAGE URL'); background-position: 50% 50%; background-repeat: no-repeat; }Do that for each of your CTA element, with there corresponding classes.
If this does not work, provide us the site URL.
Hope it helps, Cheers!
January 5, 2017 at 3:32 pm #1317883
850itParticipantThanks, it worked.
But can I also change the picture on hover with another picture?
Thanks
January 5, 2017 at 5:11 pm #1317960
850itParticipantCan you please help me
January 5, 2017 at 7:19 pm #1318175
NicoModeratorHi There,
You could change the image hover by adding this code below.
a.myclass:hover { background-image: url('BACKGROUND IMAGE URL'); background-position: 50% 50%; background-repeat: no-repeat; }Hope it helps.
Let us know how it goes.
Thanks.
January 6, 2017 at 2:15 am #1318524
850itParticipantThanks, that worked great!
Can I also add a fade animation when the backgrounds change? Now they change instantly, I want to smooth it out a little bit.
January 6, 2017 at 2:46 am #1318546
Rue NelModeratorHello There,
Thanks for letting us know that it works out for you. If you want to add some transition, please have the code updated and use this instead:
a.myclass { background-image: url('BACKGROUND IMAGE URL'); background-position: 50% 50%; background-repeat: no-repeat; transition: background 0.5s ease; } a.myclass:hover { background-image: url('BACKGROUND IMAGE URL'); background-position: 50% 50%; background-repeat: no-repeat; transition: background 0.5s ease; }Hope this helps. Please let us know how it goes.
January 6, 2017 at 8:02 am #1318804
850itParticipantThanks, it works great!
January 6, 2017 at 9:12 am #1318886
RahulModeratorGlad to hear it!
If you have anything further to ask, kindly let us know. We would be happy to assist you with anything.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1317835 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>

