IE9 根本不支持 display: inline-flex 吗? [英] Does IE9 not support display: inline-flex at all?

查看:111
本文介绍了IE9 根本不支持 display: inline-flex 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找 StackOverflow 甚至其他地方可以找到 display: inline-flex; 是否在 IE9 中工作.当我在动态扩展宽度时遇到问题时,我在此之前发布了一个问题,的 SO 用户的回答:

<块引用>

我从你的问题中了解到,你知道IE9 不支持 flexbox.flexbox 的 polyfill,名为 flexie.js,确实存在(未维护 afaik),但它使用旧的 2009flexbox 的语法.

当然不推荐使用旧语法,因为 2009 的语法真的已经过时了,许多浏览器不会再认了.但是,您可以尝试使用 Autoprefixer,它将新语法规则转换为旧语法规则(同时保留支持它的浏览器的新语法).

有一些警告 - 您将无法使用内联样式,您必须在 CSS 文件中编写样式,而且我认为它不支持动态更改DOM.

免责声明:我没有在 IE9 + flexie 上尝试过这种方法.

I've been looking around StackOverflow and even else where to find if display: inline-flex; works in IE9. I posted a question before this when I had trouble with expanding a width dynamically, question here.

The answer helped me out, thank you who ever you are! Now that I've fixed the issue and it works fine in Chrome, Opera, Mozilla, Safari, IE10+, I still have trouble making this work in IE9.

I've also tried to add pre-fix for display: inline-flex; such as display: -webkit-inline-box, -ms-inline-flexbox, and so on.

The problem I had which fixed the whole deal was width: auto; and display: inline-flex;

Working fiddle here

How can I make this to work in IE9?

解决方案

As you can see here: Can I use FlexBox? Flexbox is not supported in IE9

EDIT : Based on OP comment to answer:

if there's any way to make it work in IE9, with prefix or something?

here is a SO users' answer from another related question:

I understand from your question, that you are aware of the fact that IE9 does not support flexbox. A polyfill for flexbox, named flexie.js, does exist (not maintained afaik), but it works using the old 2009 syntax of flexbox.

Using the old syntax is of course not recommended, since the 2009 syntax is really outdated and many browsers won't recognize it anymore. But, you can try to use Autoprefixer, which transforms new-syntax rules to old-syntax rules (while preserving the new-syntax for browsers that do support it).

There are caveats - You won't be able to use inline-style, you would have to write your styles in CSS files, and I don't think it supports dynamic changes to the DOM.

Disclaimer: I haven't tried that method with IE9 + flexie.

这篇关于IE9 根本不支持 display: inline-flex 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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