是否有可能避免使用CSS3-Pretag?

时间:2015-05-06 19:44:48

标签: html css html5 css3

我可以避免使用CSS3-Pretag(-webkit-, - ms - , - o-)来保持源代码的简洁和简单,因为我在网站上使用了很多CSS3。

例如:

.scroll-up:hover:before {
    animation-delay: 0s;
    animation-duration: 0.65s;
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
    animation-name: scrollUp;
    animation-timing-function: ease-out;
    -webkit-animation-delay: 0s;
    -webkit-animation-duration: 0.65s;
    -webkit-animation-fill-mode: forwards;
    -webkit-animation-iteration-count: 1;
    -webkit-animation-name: scrollUp;
    -webkit-animation-timing-function: ease-out;
    -ms-animation-delay: 0s;
    -ms-animation-duration: 0.65s;
    -ms-animation-fill-mode: forwards;
    -ms-animation-iteration-count: 1;
    -ms-animation-name: scrollUp;
    -ms-animation-timing-function: ease-out;
    -o-animation-delay: 0s;
    -o-animation-duration: 0.65s;
    -o-animation-fill-mode: forwards;
    -o-animation-iteration-count: 1;
    -o-animation-name: scrollUp;
    -o-animation-timing-function: ease-out;
}

1 个答案:

答案 0 :(得分:0)

如果目标浏览器范围需要供应商前缀,则不 - 您必须包含它们。

您可以使用Sass之类的预处理程序和Bourbon之类的库来简化您的工作代码,或使用Autoprefixer-prefix-free之类的后期处理程序来调整您的代码写完了。

您可以使用http://caniuse.com/检查是否确实需要前缀,以及MDN上的兼容性表格。

相关问题