【问题标题】:css columns not showing correctly in ie9 and ie8css 列在 ie9 和 ie8 中未正确显示
【发布时间】:2014-01-13 23:23:01
【问题描述】:

有谁知道如何让 css3 列在 ie8 和 9 中工作?不是出现三列,而是只有一个列表。任何帮助,非常感谢!

【问题讨论】:

    标签: internet-explorer cross-browser


    【解决方案1】:

    Internet Explorer 8 和 9 不支持 CSS 列。不是until version 10,微软首先在浏览器中添加了这种缺少前缀的支持。因此,您将无法在早期版本的 Internet Explorer 中获得原生 CSS 列支持。

    您可能拥有的最佳解决方案是有条件地加载a plugin,它可以在旧版浏览器中为您实现类似的功能。考虑以下几点:

    <style>
        #columns {
            -webkit-column-width: 200px;
            -moz-column-width: 200px;
            column-width: 200px;
        }
    </style>
    <!--[if lte IE 9 ]>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.js"></script>
    <script>
        $(function () {
            $('#columns').columnize({ width: 200 });
        });
    </script>
    <![endif]-->
    

    在这种情况下,Internet Explorer 10+ 和其他现代浏览器将使用 CSS 方法。 Internet Explorer 9 及更低版本将使用 jQuery 替代方案。

    请务必使用 jQuery 的 1.x 分支,因为 2.x 分支将不支持旧版本的 IE。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-06
      • 1970-01-01
      • 2012-08-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多