按钮是否允许显示:网格,或者更一般地说,是否有任何元素不能使用display:grid
?
考虑:
button,
div {
display: grid;
grid-template-columns: 50px 50px;
}
/* Nevermind these, they're just for a consistent display */
button,
div {
border: 0;
background-color: gray;
color: black;
width: 100px;
text-align: center;
font-family: sans-serif;
font-size: 14px;
padding: 0;
}
Button:
<button>
<span>A</span>
<span>B</span>
</button>
<br>
Div:
<div>
<span>A</span>
<span>B</span>
</div>
在 JsFiddle 上尝试一下 https://jsfiddle.net/p7o8gd09/12/
这是结果Firefox(61.0.1):
这就是结果Chrome(68.0.3440.106):
Chrome 似乎不喜欢我正在尝试使用的display:grid
在按钮上。这只是一个错误吗?或者是有意为之?
显然这是 Chrome 上的一个错误,详细信息如下:
https://github.com/rachelandrew/gridbugs#10-some-html-elements-can-be-grid-containers https://github.com/rachelandrew/gridbugs#10-some-html-elements-cant-be-grid-containers
并在这里跟踪:
https://bugs.chromium.org/p/chromium/issues/detail?id=375693 https://bugs.chromium.org/p/chromium/issues/detail?id=375693
(I don't see a progress here. If it fixed, please edit the answer or I will if I remember)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)