<div class="square red" data-scale="1">scaleX(1)</div>
<div class="square red" data-scale="0.5">scaleX(0.5)</div>
<div class="square red" data-scale="-0.5">scaleX(-0.5)</div>
<div class="square red" data-scale="-1">scaleX(-1)</div>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
overflow: hidden;
font-family: sans-serif;
}
.square {
box-sizing: border-box;
width: 200px;
height: 200px;
margin-right: 20px;
padding-top: 20px;
color: #fff;
font-size: 1.5em;
text-align: center;
background: #03a9f4;
}
[data-scale="1"] {
transform: scaleX(1);
}
[data-scale="0.5"] {
transform: scaleX(0.5);
}
[data-scale="-0.5"] {
transform: scaleX(-0.5);
}
[data-scale="-1"] {
transform: scaleX(-1);
}
.red {
background: #ef5350;
}
.green {
background: #66bb6a;
}
.blue {
background: #42a5f5;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.