17

It's working elsewhere on the site using the same CSS as far as I can tell. It works in Chrome. Here is the full page: anthonyotislawrence.com

Here's the part that's not working:

<a class="socialBox linkedIn">
    <h3>LinkedIn</h3>
    <p>linkedin.com/anthonyotislawrence</p>
</a> 
<a class="socialBox facebook">
    <h3>Facebook</h3>
    <p>facebook.com/anthonyotislawrence</p>
</a>

and the CSS

.socialBox {
    display:block;
    min-width:200px;
    padding:4px 0 4px 55px;
    height:40px;
    line-height:20px;
    background-repeat:no-repeat;
    background-position:left center;
    position:relative;
    -webkit-transition: all .5s ease-out;
    -moz-transition: all .5s ease-out;
    transition: all .5s ease-out;
    text-decoration:none;
    margin:30px 0;
}
.socialBox.linkedIn {
    background-image:url(../images/linkedin.png);
}
.socialBox.facebook {
    background-image:url(../images/facebook.png);
}
.socialBox:hover {
    left:15px;
    cursor:pointer;
}
.socialBox:hover p {
    text-decoration:underline;
}
Ben
  • 2,917
  • 10
  • 28
  • 47
  • Hi, I have practically the same structured css as you in my project and I have the same problem in FF... I think it is to do with the background-image property ... I changed my background-image:url(../images/linkedin.png); to just a plain background to see if the transition would work and it did... background: #fff; ... that doesnt solve it still but it just indicates that it is to do with using transition on background-image.. i'm still looking for solutions... – Sarah May 27 '15 at 22:10

2 Answers2

41

It looks like FF wont transition default values. They have to be declared on the original element before it will transition to the new properties.

Ben
  • 2,917
  • 10
  • 28
  • 47
  • 4
    I'm doing what is suggested in this answer, and still no beans. I'm trying to transition top, and opacity, and it isn't animating. – finiteloop Jul 19 '13 at 22:13
  • 3
    thank god.. you just saved me so much time. Ben, you are a boss – Tallboy Aug 05 '13 at 23:32
  • Thank you. This also affects in Webkit browsers. – Dean Oakley Mar 30 '14 at 01:06
  • @Ben Hi, I have practically the same structured css as this in my project and I have the same problem in FF... I think it is to do with the background-image property ... I changed my background-image:url(../images/linkedin.png); to just a plain background to see if the transition would work and it did... background: #fff; ... that doesnt solve the problem but it just indicates that it is to do with using transition on background-image.. i'm still looking for solutions... any ideas? thanks – Sarah May 27 '15 at 22:11
  • @Ben me again.. actually i've just found out that background-image is not an animatible property... this makes sense now.. http://www.w3.org/TR/css3-transitions/#animatable-properties – Sarah May 27 '15 at 22:18
  • The background-image itself is not animatible, but the position should be. Also looking around, it seems it's not a standard but some browsers might also animate/transition background-size property. – Ben May 29 '15 at 02:53
  • I am sorry, but this answer is completely nebulous. Do you mean you have to add in-line styles to the element? If so, please use the correct language. – Alex Luecke Mar 23 '16 at 21:32
4

I had an issue similar to the OP where my transitions worked in every browser except Firefox. In my case I had intervals of zero seconds. I used just a 0 and not 0s. This caused the transition to not work at all in Firefox. I don't think this was the issue for the OP but posting here in case it helps someone else.

This does not work in Firefox:

top 0 linear 1s

This works:

top 0s linear 1s
SkipHarris
  • 2,334
  • 1
  • 25
  • 31