开发者社区> 问答> 正文

想问下前端需要考虑的兼容性浏览器有哪些?

杨冬芳 2016-06-06 12:37:09 1391

如今我们公司主要考虑最低ie8;我在做gulp-autoprefixer时在想其他浏览器如firefox/ios等主流浏览器我需要支持什么版本呢?

gulp.task("prefixer", function(){
    gulp.src("app/css/**/*.css")
        .pipe(autoprefixer(
            {
                browser: ['这个到底要考虑什么版本'],
                cascade: false
            }
        ))
        .pipe(gulp.dest("dist"))
});

以下是文档里的,我不知道改怎么选才好:

Queries

You can specify the versions by queries (case insensitive):

last 2 versions: the last 2 versions for each major browser.
last 2 Chrome versions: the last 2 versions of Chrome browser.
> 5%: versions selected by global usage statistics.
> 5% in US: uses USA usage statistics. It accepts two-letter country code.
ie 6-8: selects an inclusive range of versions.
Firefox > 20: versions of Firefox newer than 20.
Firefox >= 20: versions of Firefox newer than or equal to 20.
Firefox < 20: versions of Firefox less than 20.
Firefox <= 20: versions of Firefox less than or equal to 20.
Firefox ESR: the latest [Firefox ESR] version.
iOS 7: the iOS browser version 7 directly.
not ie <= 8: exclude browsers selected before by this query. You can add not to any query.
Blackberry and Android WebView will not be used in last n versions. You should add them by name.

Browserslist works with separated versions of browsers. To use all versions of some browsers you can use for example Firefox > 0, but it is bad practice.

Browsers

Names are case insensitive:

Android for Android WebView.
BlackBerry or bb for Blackberry browser.
Chrome for Google Chrome.
Firefox or ff for Mozilla Firefox.
Explorer or ie for Internet Explorer.
Edge for Microsoft Edge.
iOS or ios_saf for iOS Safari.
Opera for Opera.
Safari for desktop Safari.
OperaMobile or op_mob for Opera Mobile.
OperaMini or op_mini for Opera Mini.
ChromeAndroid or and_chr for Chrome for Android (mostly same as common Chrome).
FirefoxAndroid or and_ff for Firefox for Android.
ExplorerMobile or ie_mob for Internet Explorer Mobile.

请大神帮我解答一下啊?谢谢了

Web App开发 前端开发 Android开发 iOS开发
分享到
取消 提交回答
全部回答(1)
  • 杨冬芳
    2019-07-17 19:28:12

    如果要考虑PC端

    ['> 1%', 'Firefox >= 10', 'ie >= 9', 'iOS >= 4', 'Chrome >= 10'];

    只考虑移动端

    ['Firefox >= 10', 'iOS >= 4', 'Chrome >= 10']
    0 0

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程