Home  >  Article  >  Web Front-end  >  How to achieve vertical flip effect in css3

How to achieve vertical flip effect in css3

WBOY
WBOYOriginal
2021-12-14 11:14:502999browse

In css, the transform attribute can be used to achieve a vertical flip effect. This attribute can rotate, scale, move or tilt the element. When this attribute is used in conjunction with the rotateX() function, the element can be set to flip vertically. Style, the syntax is "element {transform:rotateX(flip angle);}".

How to achieve vertical flip effect in css3

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

How to achieve vertical flip effect in css3

In css, if you want to achieve vertical flip effect, you can use the transform attribute. The transform attribute can Elements are rotated, scaled, moved or tilted or flipped.

When the attribute is used in conjunction with the rotateX() function, you can set the style of vertical flipping of elements.

The example is as follows:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
.img1{
transform:rotateX(180deg);
}
</style>
</head>
<body>
<img  src="1118.02.png" class="img1" alt="How to achieve vertical flip effect in css3" ><br>
<img  src="1118.02.png" alt="How to achieve vertical flip effect in css3" >
</body>
</html>

Output result:

How to achieve vertical flip effect in css3

##(Learning video sharing:

css video tutorial

The above is the detailed content of How to achieve vertical flip effect in css3. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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