子元素上的CSS3翻译不起作用 [英] Css3 Translate on child element doesn't work

查看:0
本文介绍了子元素上的CSS3翻译不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的css:

#sort_dropdown:hover > .arrow{
    -webkit-transform: translate(0,-42px);
    -moz-transform: translate(0,-42px);
    -o-transform: translate(0,-42px);
    transform: translate(0,-42px);

}

以下是我的代码:

<li><a id="sort_dropdown">Sortieren <span class="arrow">&darr;</span><span class="arrow" style="display: none;">&uarr;</span></a>

推荐答案

转换仅适用于具有块级显示的元素。将.arrow设置为display: inline-block(默认情况下跨度显示inline)会起作用(jsFiddle demo):

.arrow {
    display: inline-block;
}

这篇关于子元素上的CSS3翻译不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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