Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

complete styles for cross browser CSS zoom

Tags:

I am finding it hard to get fully cross browser CSS zoom properties ..what I've is only these

zoom: 2; -moz-transform: scale(2); 
like image 728
Hello World Avatar asked Nov 15 '12 08:11

Hello World


People also ask

What is * Zoom in CSS?

The zoom property in CSS allows you to scale your content. It is non-standard, and was originally implemented only in Internet Explorer. Although several other browsers now support zoom, it isn't recommended for production sites.

How do I fix zoom in CSS?

The non-standard zoom CSS property can be used to control the magnification level of an element. transform: scale() should be used instead of this property, if possible. However, unlike CSS Transforms, zoom affects the layout size of the element.


1 Answers

These will be sufficient for cross browser...

Demo

Note: As @martin pointed out that this may not work as intended, doesn't mean this fails, Chrome just makes it 2x larger than other browsers, because it RESPECTS zoom property as well. So it makes it 2x larger...

zoom: 2; /* IE */ -moz-transform: scale(2); /* Firefox */ -moz-transform-origin: 0 0; -o-transform: scale(2); /* Opera */ -o-transform-origin: 0 0; -webkit-transform: scale(2); /* Safari And Chrome */ -webkit-transform-origin: 0 0; transform: scale(2); /* Standard Property */ transform-origin: 0 0;  /* Standard Property */ 

HTML

<div class="zoom">BlahBlah</div> 

CSS

.zoom {     zoom: 2;     -moz-transform: scale(2);     -moz-transform-origin: 0 0;     -o-transform: scale(2);     -o-transform-origin: 0 0;     -webkit-transform: scale(2);     -webkit-transform-origin: 0 0;     transform: scale(2); /* Standard Property */     transform-origin: 0 0;  /* Standard Property */ } 
like image 101
Mr. Alien Avatar answered Oct 16 '22 11:10

Mr. Alien