【发布时间】:2018-08-26 21:11:35
【问题描述】:
我正在尝试创建一个两列布局,左列固定高度,右列包含另一个多行网格。
但是,第二列的第一行始终是左列的高度。
这是输出:
这是我的代码:
class App extends Component {
render() {
return (
<div>
<Grid fluid >
<Row>
<Col xs={2} style={{ padding: '0px', backgroundColor: 'lightblue', height: '200px' }}>
Column 1 <br/>I am a 200 px tall column</Col>
<Col xsOffset={2}>
<Grid>
<Row style={{backgroundColor: 'red'}}>
Column 2 <br/> Why am I so tall???
</Row>
<Row style={{backgroundColor: 'green'}}>
I am too far down!
</Row>
<Row style={{backgroundColor: 'lightgray'}}>
Me, too!
</Row>
</Grid>
</Col>
</Row>
</Grid>
</div>
);
}
}
【问题讨论】:
标签: javascript css reactjs twitter-bootstrap-3 react-bootstrap