What Does 'zoom' do in CSS?

前端 未结 7 1053
孤独总比滥情好
孤独总比滥情好 2020-11-29 00:09

I found that some jQuery Plugin, in their css rule uses \'zoom\' descriptor, I even Look into w3c website and found that it is used to magnify but how can I actually impleme

相关标签:
7条回答
  • 2020-11-29 00:53

    CSS zoom property is widely supported now > 86% of total browser population.

    See: http://caniuse.com/#search=zoom

    document.querySelector('#sel-jsz').style.zoom = 4;
    #sel-001 {
      zoom: 2.5;
    }
    #sel-002 {
      zoom: 5;
    }
    #sel-003 {
      zoom: 300%;
    }
    <div id="sel-000">IMG - Default</div>
    
    <div id="sel-001">IMG - 1X</div>
    
    <div id="sel-002">IMG - 5X</div>
    
    <div id="sel-003">IMG - 3X</div>
    
    
    <div id="sel-jsz">JS Zoom - 4x</div>

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