0
我想讓這個CSS工作。任何人都可以讓這個CSS工作
CSS
.GridContainer {
width: 99%;
height: 500px;
border: 1px solid black;
display: inline-table;
padding: 0;
margin: 0;
}
.GridContainer .TopLineContainer {
border-bottom: 1px solid black;
display: inline-table;
padding: 0;
margin: 0;
width: 100%;
}
.GridContainer .TopLineContainer .ExtraInfoContainer {
width: 180px;
border-right: 1px solid black;
display: inline-table;
padding: 0 0 0 6px;
margin: 0 -5px 0 0;
}
.GridContainer .TopLineContainer .GuidedNavigationContainer {
display: inline;
width: 100%;
padding: 0 0 0 6px;
}
.GridContainer .BodyContainer {
display: inline-table;
height: 100%;
border-bottom: 1px solid black;
padding: 0;
margin: 0;
width: 100%;
background-color: Aqua;
}
.GridContainer .BodyContainer .GuidedNavigationTreeContainer {
float: left;
width: 180px;
border-right: 1px solid black;
display: inline-table;
padding: 0 0 0 6px;
margin: 0 -5px 0 0;
background-color: Red;
}
.GridContainer .BodyContainer .ContentContainer {
float: left;
display: inline-table;
padding: 0 0 0 6px;
overflow: scroll;
background-color: Orange;
}
.GridContainer .BodyContainer .ContentContainer .ContentDataGrid {
display: inline-table;
width: 2400px;
}
.ContentDataGrid .ContentDataGridHeader { display: inline-table }
.ContentDataGrid .ContentDataGridHeader .Column { display: inline-table }
HTML
<div class="GridContainer">
<div class="TopLineContainer">
<div class="ExtraInfoContainer">
Extra info container
</div>
<div class="GuidedNavigationContainer">
guided nav container
</div>
</div>
<div class="BodyContainer">
<div class="GuidedNavigationTreeContainer">
guided nav item list
</div>
<div class="ContentContainer">
<div class="ContentDataGrid">
sadfasd fasdf gadsfgkjh asdlfkgjhsdlkjfgh sldkfjhg sadfasd fasdf gadsfgkjh asdlfkgjhsdlkjfgh sldkfjhg sadfasd fasdf gadsfgkjh asdlfkgjhsdlkjfgh sldkfjhg sadfasd fasdf gadsfgkjh asdlfkgjhsdlkjfgh sldkfjhg sadfasd fasdf gadsfgkjh asdlfkgjhsdlkjfgh sldkfjhg
</div>
</div>
</div>
</div>
然而,正如你可以在的jsfiddle看到,橙色部分不旁邊似乎紅色和其父不滾動。
因此,應該發生的事情是,紅色在左邊,橙色在右邊,當內容超出父級的邊界時,藍色應該滾動橙色。
這看起來像表格數據 - 爲什麼不使用的表呢? – jzm
好問題。當屏幕寬度與不同電腦的不同時,我遇到了很多問題 – griegs
請參閱下面的答案 – jzm