1
I need to make a transition Fill from left in the background of a button. Something much like what you’re in http://h5bp.github.io/Effeckt.css/dist/#0 (search for the button "Fill from left").
I want that when I hover the mouse over it, it fills the background from left to right. My syntax is like this:
.BT{
font-size: 12px;
height: 30px;
left: 330px;
line-height: 30px;
top: 350px;
width: 110px;
}
And the hover of that button, which is wrong, is like this:
.BT:hover{background-color:red;
transform:translate(-10%, 0px);
transition:transform 500ms ease 0s;
}
What happens is he’s moving the button, wanted to do a test to move internally.
Your tip worked 100%. I have just one question, I saw you used CSS3, does it roll in IE8? D
– Felipe Viero Goulart
He just won’t have the smooth transition.
– Gustavo Rodrigues
And I had already forgotten: you have to change the background for a static image.
– Gustavo Rodrigues
Dude, okay 10, now I’m going to ask you a really stupid question, how do you make him transition from left to right? the opposite of what he is now?
– Felipe Viero Goulart
Change the background-position.
– Gustavo Rodrigues
I made changes to "background-position" and was unsuccessful. =/
– Felipe Viero Goulart
Change the value
background-position
between the rules with and without:hover
.– Gustavo Rodrigues
Got it, thank you again! : D . btn { background: #fff linear-gradient(90deg, #8f2 50%, #59f 50%); background-position: 100% center; background-size: 200%; Transition: background-position 1s; text-align: center; padding: 1em; } . btn:Hover { background-position: 0% center; }
– Felipe Viero Goulart