How to rotate, zoom in and out in css3

WBOY
Release: 2021-12-16 17:56:27
Original
3178 people have browsed it

Method: 1. Use the transform attribute and rotate function to set the element rotation, the syntax is "transform:scale (angle);"; 2. Use the transform attribute and scale function to set the element zoom, the syntax is "transform: scale (zoom factor);".

How to rotate, zoom in and out in css3

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

How to rotate, enlarge and shrink in css3

In css, you can use the transform attribute to rotate, enlarge and shrink elements.

When this attribute is used in conjunction with the rotate function, the element can be set to rotate. When the transform attribute is used in conjunction with the scale function, the element can be enlarged or reduced.

The example is as follows:

<html>
<head>
<style> 
.img1{
transform:rotate(45deg);
}
.img2{
transform:scale(0.5);
}
.img3{
transform:scale(1.545deg);
}
</style>
</head>
<body>
<img  src="1118.02.png" class="img1" alt="How to rotate, zoom in and out in css3" >
<img  src="1118.02.png" class="img2" alt="How to rotate, zoom in and out in css3" >
<img  src="1118.02.png" class="img3" alt="How to rotate, zoom in and out in css3" >
</body>
</html>
Copy after login

Output result:

How to rotate, zoom in and out in css3

(Learning video sharing: css video tutorial)

The above is the detailed content of How to rotate, zoom in and out in css3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template