我有一個簡單的頁眉佈局和3列的主要部分。中間一列應該包含一個冗長的內容,所以我希望它滾動,我不能讓它發生。 這是問題的一個原型: http://codepen.io/ValYouW/pen/GZxKBa如何滾動上下文flex div
UPDATE:對不起,不提,但我的意思是用於水平滾動,而不是垂直...
html, body {
height: 100%;
}
body {
margin: 0;
padding: 0;
display: flex;
box-sizing: border-box;
}
#layout {
display: flex;
flex: 1;
flex-direction: column;
border: 4px solid red;
}
#header {
border: 2px solid yellow;
}
#main {
border: 2px solid green;
display: flex;
flex: 1;
flex-direction: row;
}
#facets{
border: 2px solid pink;
display: flex;
width: 100px;
}
#report {
border: 2px solid pink;
display: flex;
flex: 1;
flex-direction: column;
}
#rightside {
border: 2px solid pink;
display: flex;
width: 100px;
}
#chips {
border: 2px solid orange;
}
#leads-grid {
border: 4px solid orange;
display: flex;
flex: 1;
overflow: auto;
}
#grid1 {
border: 2px solid black;
width: 1000px;
}
<div id="layout">
<div id="header">Header</div>
<div id="main">
<div id="facets">Facets</div>
<div id="report">
<div id="chips">Chips</div>
<div id="leads-grid">
<div id="grid1">How to make my parent (#leads-grid) scroll?</div>
</div>
</div>
<div id="rightside">Right side</div>
</div>
<div>
任何想法如何使#鉛柵格滾動? Thx。
'#導線,grid'做滾動不已:http://codepen.io/anon/pen/ONvJEp –
你的意思是讓'#grid1'卷軸? http://codepen.io/anon/pen/jqzOKZ –
在Chrome上測試。 –