2
考慮下面的代碼Firefox不顯示錶行作爲Chrome和Internet Explorer
HTML:
<div class="ci-v-stack-panel" style="width: 400px; height: 500px; border: 1px dashed green;">
<div id="white" class="ci-v-panel">
<div style="height: 50px">
<span>content 0</span>
</div>
</div>
<div id="red" class="ci-v-panel">
<span>content 1</span>
</div>
<div id="green" class="ci-v-panel">
<span>content 2</span>
</div>
<div id="blue" class="ci-v-panel auto">
<span style="border: 1px dashed black;">content 3</span>
</div>
</div>
CSS:
#white {
background-color: white;
}
#red {
background-color: red;
}
#green {
background-color: green;
}
#blue {
background-color: blue;
color: white;
}
.ci-v-stack-panel {
display: table;
table-layout: auto;
}
.ci-v-panel {
display: table-row;
height: 0 !important;
width: 100% !important;
}
.auto {
height: auto !important;
}
我得到了以下結果: 在codepen上查看:http://codepen.io/mcl7cdm/pen/BzjqQq
最後一個瀏覽器是Firefox。
我應該怎麼做才能讓它在Firefox中看起來一樣?
嘗試設置最後一排'高度:100%',並請刪除所有'important'它使事情*瘋了! *。 – Stickers
@Pangloss Yepp,也可以工作:) ...和**是是是**(刪除'!important') – LGSon
刪除auto中的「important」會打破預期結果。汽車面板必須填滿所有可用空間。例如,如果有兩個自動面板,則可用空間必須在它們之間平均分配。 –