1

Im doing a menu icon for my webpage, which on every browser looks good except on safari where I'm having some weird animations on the change of state from normal to hover.

Here is the JSfiddle which shows the problem:

https://jsfiddle.net/x5vdt0L7/3/

CSS

#menuIcon {
    width: 12vw;
    height: 12vw;
    background: url("https://tresastronautas.com/assets/menuBlueHover.svg") no-repeat;
    background-size: cover;
    float: left;
    display: inline-block;
    transition: all 0.25s ease;
    -webkit-transition: background 0.25s ease;
}
#menuIcon:hover {
    background: url("https://tresastronautas.com/assets/menuBlue.svg") no-repeat;
    cursor: pointer;
}

HTML

<div id="menuIcon"></div>

Basically what's happening is that I'm changing the background of the div whenever the user hovers on it, but when this happens the new background gets loaded bigger than the div and then it gets adjusted to the div, so it looks really messy.

Alejandro Cordoba
  • 447
  • 1
  • 6
  • 19

0 Answers0