How to zoom/scale a button on hover - Forum | JoomShaper
Staff replied SP Page Builder

How to zoom/scale a button on hover

Asked by P.C. 2 years ago Last activity 2 years ago

Hi all,

I would like to know if is possible to zoom/scale a button on hover.

In the interaction I can enable Tilt Effect, but I would like to use the scale effect on over the button.

Someone could you help me?

Thank you in advance,

P.


P.S. I can't share the link, the site is in local.

6 replies

P.C. Asked this

I solved it like this:

.sppb-button-wrapper

{
display: block;
background: transparent;
transition: .3s ease-in-out 0s;
}

.sppb-button-wrapper:hover

{
cursor: pointer;
transform: scale(0.95);
}

        :-)
Paul Frankowski Senior Staff

Yes, it will work,

you should also add: .sppb-button-wrapper:focus, before :hover line.

P.C. Asked this

Thank you Paul,
I tried, but it works in this version:

.sppb-button-wrapper
{
display: block;
background: transparent;
transition: .3s ease-in-out 0s;
}

.sppb-button-wrapper:hover
{
cursor: pointer;
transform: scale(0.95);
}

And it doesn't work in this version:

.sppb-button-wrapper
{
display: block;
background: transparent;
transition: .3s ease-in-out 0s;
}

.sppb-button-wrapper:focus
.sppb-button-wrapper:hover
{
cursor: pointer;
transform: scale(0.95);
}

        Where I'm wrong?
Paul Frankowski Senior Staff

"," is missing (!) between class names - look how should be

.sppb-button-wrapper:focus, .sppb-button-wrapper:hover

P.C. Asked this

Is this the correct version?

.sppb-button-wrapper

{ display: block;
background: transparent;
transition: .3s ease-in-out 0s; }

.sppb-button-wrapper:focus,
.sppb-button-wrapper:hover

{ cursor: pointer;
transform: scale(0.95); }

if so, it's not working for me. However, with the first code I used it works...

Paul Frankowski Senior Staff
2 years ago · edited

Use what works for you. This is probably the simplest answer :O)


Sometimes problem is with Cache (Joomla/Browser), becuase CSS seems to be OK. But am not here to validate CSS for obvious reasons.

Log in to reply.