CSS Property zoom








The zoom property in CSS can zoom elements

CSS Syntax

.zoom {
  zoom: 150%;
}

Property Values

percentage
Scale by this percentage
number
Convert to percentage and scale. 1 == 100%; 1.5 == 150%;
normal
zoom: 1;

Browser compatibility

zoom Yes Yes No Yes Yes




Example

<!DOCTYPE html>
<html>
<style>
img:nth-child(2) {<!--from  w  w  w . ja  va2  s.c  o m-->
  zoom: 150%;
}
img:nth-child(3) {
  zoom: 1.8;
}
img:nth-child(4) {
  zoom: 0.2;
}
</style>
</head>
<body>
<img src="http://java2s.com/style/demo/border.png">
<img src="http://java2s.com/style/demo/border.png">
<img src="http://java2s.com/style/demo/border.png">
<img src="http://java2s.com/style/demo/border.png">
</body>
</html>

Click to view the demo