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

前端 未结 12 636
猫巷女王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:37

    I would change zoom for transform in all cases because, as explained by other answers, they are not equivalent. In my case it was also necessary to apply transform-origin property to place the items where I wanted.

    This worked for me in Chome, Safari and Firefox:

    transform: scale(0.4);
    transform-origin: top left;
    -moz-transform: scale(0.4);
    -moz-transform-origin: top left;
    
    0 讨论(0)
  • 2020-11-29 02:38

    For me this works to counter the difference between zoom and scale transform, adjust for the intended origin desired:

    zoom: 0.5;
    -ms-zoom: 0.5;
    -webkit-zoom: 0.5;
    -moz-transform:  scale(0.5,0.5);
    -moz-transform-origin: left center;
    
    0 讨论(0)
  • 2020-11-29 02:39
    zoom: 145%;
    -moz-transform: scale(1.45);
    

    use this to be on the safer side

    0 讨论(0)
  • 2020-11-29 02:40

    It does not work in uniform way in all browsers. I went to to: http://www.w3schools.com/html/tryit.asp?filename=tryhtml_pulpitimage and added style for zoom and -moz-transform. I ran the same code on firefox, IE and chrome and got 3 different results.

    <html>
    <style>
    body{zoom:3;-moz-transform: scale(3);}
    </style>
    <body>
    
    <h2>Norwegian Mountain Trip</h2>
    <img border="0" src="/images/pulpit.jpg" alt="Pulpit rock"  />
    
    </body>
    </html>
    
    0 讨论(0)
  • 2020-11-29 02:42

    try this code to zoom the whole page in fireFox

    -moz-transform: scale(2);
    

    if I am using this code, the whole page scaled with y and x scroll not properly zoom

    so Sorry to say fireFox not working well using "-moz-transform: scale(2);"
    

    **

    Simply you can't zoom your page using css in fireFox

    **

    0 讨论(0)
  • 2020-11-29 02:44

    For me this works well with IE10, Chrome, Firefox and Safari:

       #MyDiv>*
       {
            zoom: 50%;
            -moz-transform: scale(0.5);
            -webkit-transform: scale(1.0);
       }
    

    This zooms all content in to 50%.

    0 讨论(0)
提交回复
热议问题