mortezashojaei
mortezashojaei

Reputation: 452

how can i get slower animaton in css scale?

I wrote this code for animate my menu

   .main-navigation a:hover{
        transform: scale(1.1)!important;

but I want slower animation with time or anything else

Upvotes: 0

Views: 51

Answers (2)

kunambi
kunambi

Reputation: 772

This should work:

.main-navigation a {
    transition: transform 250ms;
    transform-origin: center center;
}
.main-navigation a:hover{
    transform: scale(1.1) !important;
}

A friendly advice: try to setup your CSS so you don't ever have to use !important.

Upvotes: 1

Programmer
Programmer

Reputation: 2123

Add transition: 0.3s (or any other time you want).

Upvotes: 2

Related Questions