带显示的字段集:table-column完全在IE8和& IE9 [英] Fieldset with display: table-column disappears entirely in IE8 & IE9
问题描述
我只是花了一些时间试图找出为什么某些表单内容在IE8&中完全消失了。 IE9。经过一番调查后,看起来将fieldset设置为显示是错误的:table-column。如果我将fieldset设置为display:table或display:block,那么一切都会显示正常。
I just spent some trying to figure out why some form content vanished entirely in IE8 & IE9. After some investigation, it looks like it's the fault of having fieldset set to display:table-column. If I set fieldset to display:table or display:block then everything shows up fine, again.
在我的IE8&上测试这个html时IE9虚拟机,我只能看到标题不在字段集内。如果我删除了字段集样式,我可以看到两者。
When testing this html on my IE8 & IE9 virtual machines, I can see only the heading "Not inside a fieldset". If I remove the fieldset styling, I can see both.
有谁知道为什么会这样?
Does anyone know why this happens?
<html>
<head>
<style type="text/css">
fieldset
{
display: table-column;
vertical-align: top
}
</style>
</head>
<body>
<form>
<fieldset>
<div class="row">
<h6>Inside a fieldset</h6>
</div>
</fieldset>
<form>
<h6>Not inside a fieldset</h6>
</body>
</html>
推荐答案
display:table-列
表示它的行为类似于HTML中的< col>
标记。 < col>
标记是一个不可见的元素,用于指定列的属性,如样式等。它与<不同。 td>
( display:table-cell
)。
The display: table-column
means it acts like the <col>
tag in HTML. The <col>
tag is an invisible element which is used to specify properties of the column like styles etc. It is not the same as <td>
(which is display: table-cell
).
您应该使用 table-cell
。
编辑: table-column
仍会显示在IE 7,FireFox 24,Chrome和Opera 15中。它在IE 8,9和10中不起作用。
table-column
still gets displayed in IE 7, FireFox 24, Chrome and Opera 15. It doesn't work in IE 8, 9 and 10.
这篇关于带显示的字段集:table-column完全在IE8和& IE9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!