<div class="square red" data-scale="1">scale(1)</div>
<div class="square green" data-scale="1.5">scale(1.5)</div>
<div class="square blue" data-scale="0.5">scale(0.5)</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: scale(1);
}
[data-scale="1.5"] {
transform: scale(1.5);
}
[data-scale="0.5"] {
transform: scale(0.5);
}
.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.