【发布时间】:2018-08-28 12:44:27
【问题描述】:
在 Chrome 中我有 #main(橄榄色)300px(没关系)。
但在 Firefox 中我有 1180 像素。为什么?以及如何解决?
关注https://jsfiddle.net/jocke5a/vrrtyc65/1/
body {
margin: 0;
box-sizing: border-box;
}
* {
box-sizing: border-box;
}
#wrapper {
width: 100%;
display: grid;
grid-template-columns: 1fr 20px 120px 50px 20px 1fr;
grid-auto-rows: max-content;
grid-gap: 0px;
margin: 0 auto;
}
#header {
grid-column: 1 / 7;
grid-row: 1 / 2;
background-color: red;
}
#i-panel {
grid-column: 3 / 5;
grid-row: 2 / 3;
background-color: yellow;
}
#s-panel {
grid-column: 2 / 3;
grid-row: 3 / 5;
background-color: brown;
}
#n-panel {
grid-column: 5 / 6;
grid-row: 2 / 7;
background-color: blue;
}
#set {
grid-column: 4 / 5;
grid-row: 3 / 4;
background-color: green;
}
#hl-panel {
grid-column: 4 / 5;
grid-row: 4 / 7;
background-color: orange;
}
#main {
grid-column: 3 / 4;
grid-row: 3 / 5;
background-color: olive;
}
#komentare {
grid-column: 3 / 4;
grid-row: 5 / 6;
background-color: gold;
}
#footer {
grid-column: 1 / 7;
grid-row: 7 / 8;
background-color: pink;
}
<div id="wrapper">
<div id="header">
<div style="height: 60px;"></div>
</div>
<div id="i-panel">
<div style="height: 10px;"></div>
</div>
<div id="s-panel">
<div style="height: 300px;"></div>
</div>
<div id="n-panel">
<div style="height: 0px;"></div>
</div>
<div id="set">
<div style="height: 60px;"></div>
</div>
<div id="hl-panel">
<div style="height: 3700px;"></div>
</div>
<div id="main">
<div style="height: 270px;"></div>
</div>
<div id="komentare">
<div style="height: 1700px;"></div>
</div>
<div id="footer">
<div style="height: 60px;"></div>
</div>
</div>
【问题讨论】: