CSS -webkit- 和 -moz-border-radius 在桌子上不起作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1407371/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 21:04:08  来源:igfitidea点击:

-webkit- and -moz-border-radius does not work on tables?

webkitgeckocss

提问by

This works

这有效

div {
  -moz-border-radius: 5px 5px 0 0;
  border:1px solid #000;
  margin:30px;
}

This does not work

这不起作用

table {
  -moz-border-radius: 5px 5px 0 0;
  border:1px solid #000;
  margin:30px;
}

Does anyone know how to use -moz and -webkit to work on tables?

有谁知道如何使用 -moz 和 -webkit 来处理表格?

回答by SpliFF

5.6. Effect on Tables

The ‘border-radius' properties do apply to ‘table' and ‘inline-table' elements. When ‘border-collapse' is ‘collapse', the UA may apply the border-radius properties to ‘table' and ‘inline-table' elements, but is not required to. In this case not only must the border radii of adjacent corners not intersect, but the horizontal and vertical radii of a single corner may not extend past the boundaries of the cell at that corner (i.e. the cell's other corners must not be affected by this corner's border-radius). If the computed values of the border radii would cause this effect, then the used values of all the border radii of the table must be reduced by the same factor so that the radii neither intersect nor extend past the boundaries of their respective corner cells.

The effect of border-radius on internal table elements is undefined in CSS3 Backgrounds and Borders, but may be defined in a future specification. CSS3 UAs should ignore border-radius properties applied to internal table elements when ‘border-collapse' is ‘collapse'.

5.6. 对表的影响

'border-radius' 属性确实适用于 'table' 和 'inline-table' 元素。当'border-collapse'为'collapse'时,UA可以将border-radius属性应用于'table'和'inline-table'元素,但不是必需的。在这种情况下,不仅相邻角的边界半径必须不相交,而且单个角的水平和垂直半径不能超出该角的单元格的边界(即单元格的其他角不得受该角的影响边界半径)。如果边界半径的计算值会导致这种影响,则表的所有边界半径的使用值必须减少相同的系数,以便半径既不相交也不延伸超过其各自角单元的边界。

边框半径对内部表格元素的影响在 CSS3 背景和边框中未定义,但可能会在未来的规范中定义。当“border-collapse”为“collapse”时,CSS3 UA 应忽略应用于内部表格元素的 border-radius 属性。