This page is Not Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.



Specifies the magnification scale of the object.


zoom: normal number percentage


Setting the value of the zoom property on a rendered object causes the content that surrounds the object to reflow. Even though the zoom property is not inherited, it affects its children. This effect is similar to the transformation caused by the background and -ms-filter properties.


The following examples use the -ms-zoom attribute and the -ms-zoom property to change the magnification scale of a p element.

  .clsTeenyWeeny  { zoom: 0.10 }

[This example uses a style rule in an embedded style sheet to set the -ms-zoom attribute to one-tenth of normal. View live example]

This example uses inline scripting to set the -ms-zoom property to 200% when an onmouseover event occurs. The magnification scale returns to normal when the onmouseout event occurs.

<P onmouseover="'200%'"

This example provides controls that let the user adjust the -ms-zoom property.

<html xmlns:control="">
<title>Zoom Demo</title>
<script type="text/javascript">
function zoomIn() {
  newZoom= parseInt('%' =newZoom;
      oCode.innerText='zoom: '+newZoom+'';
function zoomOut() {
  newZoom= parseInt('%' =newZoom;
      oCode.innerText='zoom: '+newZoom+'';
function changeZoom() {
  newZoom= parseInt(oSlider.value)'%';
        oCode.innerText='zoom: '+newZoom+'%';
function changeZoom2(oSel) {
  newZoom= oSel.options[oSel.selectedIndex].innerText;
        oCode.innerText='zoom: '+newZoom+'';
<body onload="'100%';
    oCode.innerText='zoom: 100%'; ">
<!-- Slider and + and - controls  -->
<div style="position: absolute; top: 15px; left: 20px;">
<control:slider id="oSlider" style="sl--orientation:vertical;
    height:204px; width:28px; background-color:#336699;
    padding-left:5px; border-left:1px solid #6699CC" tickinterval="10"
    max="200" min="0" onchange="changeZoom()"> </control:slider>
<div style="position: absolute; top: 15px; left: 48px; width: 28px; height: 200px; background-color: #336699;" align="center">
    <img src="/workshop/graphics/zoomscale.gif" alt="scale" border="0" usemap="#scaler">
<!-- The zoomable area container -->
<div style="position: absolute; top: 15px; left: 76px; width: 550px; height: 204px; background-color: black; vertical-align: middle; padding: 25px; font-family: arial; font-weight: bold; color: white; z-index: 3" align="center">
    <!-- The zoomable area -->
    <div id="oZoom" style="zoom: 100%" align="center">
        <h1>Welcome to Seattle!</h1>
        <img src="/workshop/graphics/seattlesmall.jpg" alt="Seattle skyline" align="left">
        <p align="center">A great city in the beautiful state of Washington.</p>
<!-- Displayed code -->
<div style="overflow: hidden; border: 1px solid black; position: absolute; top: 219px; left: 20px; width: 606px; height: 90px; padding: 1px; padding-left: 25px; background-color: white; z-index: 3;">
    &lt;div style=&quot;
    <span style="font-weight: bold; font-family: verdana; color: red; font-size: 9pt" class="coder" id="oCode">
        &lt;h1&gt; Welcome to seattle!&lt;/h1&gt;</div>
        &lt;img src=&quot;seattlesmall.jpg&quot;&gt;</div>
        &lt;p&gt;A great city in the beautiful state of Washington.&lt;/p&gt;</div>
    <div class="coder">
<div id="oControls" style="position: absolute; top: 308px; left: 20px; width: 606px; height: 100px; background-color: gray; color: white; font-family: verdana; font-size: 11pt; font-weight: normal; padding: 10px; z-index: 3; text-align: center; border: 1px solid black; text-align: left;">
    <div style="padding-left: 65px">
        The code used to generate the image is shown in the area above. <br>
        Modify the image using the selections below or the <br>
        slider control above and to the left of this window. </div>
    <div align="center">
        <select id="percent" onchange="changeZoom2(percent); ">
        <option selected="">Use Percentage Value</option>
        </select> <select id="normal" onchange="changeZoom2(normal); ">
        <option selected="">Use Number Value</option>
<map name="scaler">
<area shape="rect" coords="0,182,19,199" alt="plus" href="#" onclick="zoomIn()" style="cursor: hand">
<area shape="rect" coords="1,1,18,15" alt="minus" href="#" onclick="zoomOut()">

View live example

See also

Related articles

Visual Effects

Other articles