Vincec's Dimension

Let IE9 Support Flex?

Word count: 293 / Reading time: 1 min
2018/07/02 Share

Flex学会后发现真是相当的方便,打算全面使用,但是一直觉得在各个浏览器上会出现问题,做个小笔记

Flex is a very elegant way for different browser sizes. However, it may fail in some case. Here is a note for testing when meeting flex failed.

Can I use

经过查询 Can I Use 网站的意外的发现支持的还不错,基本主流都已经可以支持了。

Check the flex supporting in Can I Use with modern broswers.

Autoprefixer

通过 Autoprefixer 补全各种前缀以防浏览器未更新至最新的版本。

Add the experiment prefix automatically using Autoprefixer.

fixie.js

Fixie.js 是一个大佬制作的 js 脚本,让 IE9 等完美支持 flex,当然以防万一还是先 Autoprefixer 过后

One way to use Fixie.js simulating the flex features under IE9. Suggesting to use it after Autoprefixer.

1
2
3
4
5
6
7
8
9
10
11
<head>
<!--[if lte IE 9]>

<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>

<script src="flexie.js" type="text/javascript"></script>

<![endif]-->
</head>

Reference

Author: VINCEC

Permalink: https://vince-amazing/blog/2018/07/02/fix-flex-in-ie/

Date: July 2nd 2018, 4:01:03

Copyright license: The article usingCC licensing 4.0

CATALOG
  1. 1. Can I use
  2. 2. Autoprefixer
  3. 3. fixie.js
  4. 4. Reference