Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.
Sometimes you might need to scale an item, especially when designing a page, so it looks smaller, or bigger.
You can use the CSS zoom property to scale any HTML element.
Use a value < 1 to make an element smaller. For example, half the size with 0.5:
div {
zoom: 0.5;
}
or use a value > 1 to make the element bigger, for example to scale it 2×:
div {
zoom: 2;
}
Note: this does not work in Firefox. You can use
-moz-transform: scale(NUMBER);instead (and if you go that route, you can usetransform: scale(NUMBER);on all browsers, too).