Search code examples
cssfirefoxzoomingscale

When using CSS Scale in Firefox, element keeps original position


When using scale in Firefox, the scaled element dóes get scaled properly. The problem is, that it's positioned as if it isn't scaled.

This works fine in Chrome, and probably also in IE, Safari and Opera. These browsers all support the CSS zoom property, where Firefox doesn't. For Firefox I'm using -moz-transform: scale(0.3);.

This is my CSS:

#overview .page-content {
    zoom: 0.3;
    -moz-transform: scale(0.3);
}

This is what it should look like (as in Chrome):

zoom in chrome

This is what it shouldn't look like (as in Firefox): scale in firefox

Does anybody know how to fix this? Or maybe a workaround?


Solution

  • As thirtydot mentioned:

    position: absolute;
    -moz-transform-origin: 0 0;
    

    This will do the trick.