【发布时间】:2018-03-30 20:33:08
【问题描述】:
样式 <fieldset> 工作异常。在 Google Chrome 中,div 适合内容。
.table {
border: none;
border-collapse: collapse;
display: table;
margin: 0;
min-width: auto;
padding: 0;
table-layout: fixed;
width: 100%;
}
.cell {
background: #ccc;
border: 1px solid black;
display: table-cell;
height: 50px;
}
<fieldset class="table">
<div class="cell">1</div>
<div class="cell">2</div>
<div class="cell">3</div>
</fieldset>
而我想要的是
.table {
border: none;
border-collapse: collapse;
display: table;
margin: 0;
min-width: auto;
padding: 0;
table-layout: fixed;
width: 100%;
}
.cell {
background: #ccc;
border: 1px solid black;
display: table-cell;
height: 50px;
}
<div class="table">
<div class="cell">1</div>
<div class="cell">2</div>
<div class="cell">3</div>
</div>
如何设置<fieldset> 的样式,使其看起来像后一个?
【问题讨论】:
-
将宽度(比如宽度:100px;)添加到字段集单元格类将给出你想要的。但我仍在试图理解为什么 width : 33%;没有影响