IE11中的CSS网格布局,内容差距很大

时间:2019-06-05 21:14:04

标签: html css internet-explorer internet-explorer-11 css-grid

我在页面上使用CSS网格布局,但是这在IE11上两个网格元素之间产生了巨大的内容空白:

enter image description here

在Chrome和FF中,这显然很好。这是我通过AutoPrefixer运行的CSS的功能:

import networkx as nx
import random
import numpy as np
graph = nx.fast_gnp_random_graph(20,0.3)



p_values = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9]


for i in p_values:
    print(i)

for i in p_values:

    array=[]    

    n=nx.number_of_edges(graph)
    edges = list(graph.edges)

    no_edges_del = int(n*i)
    print(no_edges_del)

    for j in range(no_edges_del):
        chosen_edge = random.choice(edges)
        print(chosen_edge)
        print(chosen_edge[0])
        graph.remove_edge(chosen_edge[0], chosen_edge[1])

        GC = nx.number_of_nodes(max(nx.connected_component_subgraphs(graph), key=len))

        array.append(GC/n)      

HTML:

Traceback (most recent call last):
  File "1.py", line 26, in <module>
    graph.remove_edge(chosen_edge[0], chosen_edge[1])
  File "D:\anaconda\lib\site-packages\networkx\classes\graph.py", line 1011, in remove_edge
    raise NetworkXError("The edge %s-%s is not in the graph" % (u, v))
networkx.exception.NetworkXError: The edge 14-15 is not in the graph

我开始把它弄乱了,我注意到了:

com.android.tools.build:gradle:X.Y.Z

似乎正在造成差距。唯一的问题是,我不确定是否有可以将其控制在.row--grid { display: grid; display: -ms-grid; -ms-grid-columns: 2fr 1fr; grid-template-columns: 2fr 1fr; -ms-grid-rows: auto 1fr; grid-template-rows: auto 1fr; margin-left: -15px; margin-right: -15px; } .row--grid > *:nth-child(1) { -ms-grid-row: 1; -ms-grid-column: 1; } .row--grid > *:nth-child(2) { -ms-grid-row: 1; -ms-grid-column: 2; } .row--grid > *:nth-child(3) { -ms-grid-row: 2; -ms-grid-column: 1; } .row--grid > *:nth-child(4) { -ms-grid-row: 2; -ms-grid-column: 2; } .top__content { -ms-grid-column: 1; grid-column: 1; } .sidebar__col { -ms-grid-column: 2; grid-column: 2; grid-row: 1 / -1; margin-left: 50px; width: 100%; padding-right: 20px; max-width: 320px; } .main__content { -ms-grid-column: 1; grid-column: 1; } 上的东西吗?像往常一样,仍然将我的头放在CSS网格周围,然后尝试调试IE。

1 个答案:

答案 0 :(得分:1)

在我这一边重现问题,在IE / Edge浏览器中,侧边栏单元格与top__content单元格位于同一行。因此,如果它太高,则top__content会自动更改height属性,以使其保持网格布局。但是在Chrome浏览器中,边栏单元格占据两行。

这似乎是浏览器问题,IE / Edge浏览器无法使用“ -ms-grid-row:1 / span 2;”合并单元格的方法,如果要合并单元格,可以使用“ -ms-grid-row-span”来设置侧边栏单元格,使其跨两行。

使用以下代码:

        .row--grid > *:nth-child(2) {
            -ms-grid-row: 1;
            -ms-grid-column: 2;
            -ms-grid-row-span:2;
        }

然后结果like this