scale()
规定 2D 缩放转换。
语法
scale(x) scale(x, y)
值
| 值 | 描述 |
|---|---|
| x | 规定X轴上的缩放比例。 |
| y | 规定Y轴上的缩放比例。 |
例子
HTML
<div class="stage"> <div class="box">transform:scale(2)</div> </div>
CSS
.stage{
width:100%;
height:200px;
background:#333;
text-align:center;
}
.box{
display:inline-block;
width:350px;
height:50px;
background:red;
font-size:20px;
color:#fff;
transform:scale(2);//在中心位置处scale(2)倍。
}
执行结果
transform:scale(2)
参考
相关页面