如何在CSS中应用多个变换? [英] How to apply multiple transforms in CSS?

查看:70
本文介绍了如何在CSS中应用多个变换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CSS,如何应用多个转换

Using CSS, how can I apply more than one transform?

示例:

li:nth-child(2) {
    transform: rotate(15deg);
    transform: translate(-20px,0px);        
}


推荐答案

一行这样:

li:nth-child(2) {
    transform: rotate(15deg) translate(-20px,0px);
}

当有多个transform指令时,只有最后一个。它像任何其他CSS属性。

When you have multiple transform directives, only the last one will be applied. It's like any other CSS attribute.

这篇关于如何在CSS中应用多个变换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆