我正试图让这个 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 中看到的那样,橙色部分不会出现在红色旁边,并且其父级不会滚动。
所以应该发生的是红色在左边,橙色在右边,当内容超出父级时,蓝色应该滚动橙色。