2018-03-06 CSS3中transform属性的旋转、缩
2018-03-06 本文已影响0人
Order不是Leader
利用transform属性对目标进行旋转、缩放和位移,代码如下:
<style>
img{
transform:scale(2); //放大2倍
}
</style>
原图:

放大之后:

<style>
img{
transform: rotate(180deg); //旋转180度
}
</style>
效果:

<style>
img{
transform: translate(100px,100px); //x方向右移100px,y方向下移100px;
}
</style>
效果:

<style>
img{
transform:translate(100px,100px)scale(2)rotate(180deg); //位移、缩放和旋转
}
</style>
