How to scale the contents of a div by a percentage with CSS?

Sometimes, we want to scale the contents of a div by a percentage with CSS.

How to scale the contents of a div by a percentage, we will look at in this article with CSS.

How to scale the contents of a div by a percentage with CSS?

By a percentage with CSS, we can set the zoom and -moz-transform CSS properties to scale the contents of a div.
For instance, we write

#myContainer {
  zoom: 0.5;
  -moz-transform: scale(0.5);
}

to scale the contents of the element with ID myContainer by a factor of 0.5 by setting zoom to 0.5 and -moz-transform to scale(0.5).

Conclusion

By a percentage, we can set the zoom and -moz-transform CSS properties to scale the contents of a div with CSS.

Leave a Reply