本文介绍了我如何解决这个IE11布局错误相关的表单元格,文本装饰和填充?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

由于百分比错误只发生在表格单元格的填充上,因此您实际上可以在范围本身上使用边距。

Because the percentage bug only occurs on the padding of a table-cell, you can actually use a margin on the span itself.

span 
{
    margin-left: 10%;
}

和ofcourse重置边的填充:

and ofcourse reset the padding of the sides:

div.table-cell {
    display: table-cell;
    padding: 20px 0;
}



这个解决方案不像表上的百分比填充一样动态,细胞本身。

This "solution" is not as dynamic as with percentage padding on the table-cell itself.

为什么不?

这是因为百分比是来自其父元素的值, -细胞。其中表格单元格取它的百分比值基于tabel。现在,当你只需使用 left-margin:5%; 。这将是一半的空间,因为它应该是。这是因为它占用了表格单元格宽度的10%。其中表格单元格宽度是由其单元格(表格宽度/表格单元格)指定的表格宽度。

Why not?
It's because the percentage takes is value from it's parent element, the table-cell. Where as the table-cell did take it's percentage value based on the tabel. Now when you would just use left-margin: 5%;. It would be half of the space as it should be. This is because it take the 10% on the table-cell width. Where the table-cell width is table width devided by its cells(table width / table cell).

所以为了修复我做了5倍的单元格数量(在这种情况下 5 * 2

So to fix that i did 5 times the amount of cells (5 * 2 in this case), which would result in the right percentage.

但是,当您要添加更多单元格时,这不是动态的。

However this is not dynamic when you want to add more cells.

在填充位重置前,使用位置为保留的边框。

保留边框

span 
{
     border-bottom: 1px solid transparent;   
}

更改不需要重新计算位置的属性;颜色

div.table-cell-bug:hover span 
{
    border-bottom-color: black; 
}

现在请注意,布局中仍然没有填充。

Now note that there will still be no padding in the layout. As soon as a property is assigned which has not been calculated before the padding did reset(the same time the text position is determed) the positions will be re-calculated.

我看到你发布了一个。当您收到回覆时,请随时与我们联络,我们非常感谢:)

I see you sended a bug report to MS. Keep us up-to-date when you get a reply, i would appreciate it :)

这篇关于我如何解决这个IE11布局错误相关的表单元格,文本装饰和填充?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:14