How can I zoom an HTML element in Firefox and Opera?

前端 未结 12 680
猫巷女王i
猫巷女王i 2020-11-29 02:00

How can I zoom an HTML element in Firefox and Opera?

The zoom property is working in IE, Google Chrome and Safari, but it’s not working in Firefox and O

12条回答
  •  佛祖请我去吃肉
    2020-11-29 02:46

    I've been swearing at this for a while. Zoom is definitely not the solutions, it works in chrome, it works partially in IE but moves the entire html div, firefox doesnt do a thing.

    My solution that worked for me was using both a scaling and a translation, and also adding the original height and weight and then setting the height and weight of the div itself:

    #miniPreview {
    transform: translate(-710px, -1000px) rotate(0rad) skewX(0rad) scale(0.3, 0.3);
    transform-origin: 1010px 1429px 0px;
    width: 337px;
    height: 476px;
    

    Obviously change these to your own needs. It gave me the same result in all browsers.

提交回复
热议问题