CSS 3 - 过渡前缀 - 哪些使用? [英] CSS 3 - transition prefixes - which ones to use?

查看:103
本文介绍了CSS 3 - 过渡前缀 - 哪些使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有关于转换的CSS供应商前缀的问题。

I have a question regarding the CSS vendor prefixes for transition.

此来源声明您需要使用所有通常的前缀,使其在所有浏览器(-o-,-webkit-,-moz-,-ms-)。

This source states that "you need to use all the usual prefixes to make this work in all browsers (-o-, -webkit-, -moz-, -ms-)".

该页面仅显示 -webkit - -moz - 前缀并声明IE 10+,FF 16+和Opera 12.1+可以读取前缀免费版本。

That page only shows the -webkit- and -moz- prefixes and claims that IE 10+, FF 16+ and Opera 12.1+ can read the prefix free version.

在Twitter Bootstrap的代码中,总是存在 -webkit - -moz - code> -o - 除了未加前缀的版本之外还有前缀版本。

In the code of Twitter Bootstrap, there is always exists a -webkit-, -moz- and -o- prefixed version in addition to the un-prefixed version.

我应该使用什么前缀?

What prefixes should I use?

推荐答案

http:// caniuse。 com /#search = transition 说,您需要为现代浏览器提供-web​​kit和plain属性。

http://caniuse.com/#search=transition says that you need -webkit- and plain property for modern browsers.

-webkit-transition: all .5s ease;
transition: all .5s ease;

但是如果你添加所有的都没有问题,只要确保没有前缀的属性最后一个。

But it will be no problem if you add all of them, just be sure that property without prefix is the last one.

编辑:如下所述,如果您点击所有版本 。现在最好还是使用-moz-和-o-。

as said in comment below, if you click on "All versions" you can see when each browser dropped prefix. For now it is better to use -moz- and -o- also.

2015年5月编辑:我强烈建议您使用 Autoprefixer 作为构建过程的步骤(如Gulp / Grunt任务)或作为代码编辑器的插件。它在caniuse.com浏览器支持统计信息上提供自动前缀。

Edit May 2015: I highly recommend use Autoprefixer as step on your build process (like Gulp/Grunt task) or as plugin to your code editor. It provides automatic prefixing on caniuse.com browser support stats.

这篇关于CSS 3 - 过渡前缀 - 哪些使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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