[英]How to stretch parent element width in layout with ant-design
You can set align-items: flex-start
to the parent container (the default value stretch causes the Content
width to be restricted ):您可以将
align-items: flex-start
设置为父容器(默认值拉伸会导致Content
宽度受到限制):
<Layout className="layout" style={{ padding: '0 24px 24px' }}>
<Breadcrumb style={{ margin: '12px 0' }}>
<Breadcrumb.Item>Home</Breadcrumb.Item>
<Breadcrumb.Item>List</Breadcrumb.Item>
<Breadcrumb.Item>App</Breadcrumb.Item>
</Breadcrumb>
<Content style={{background: '#fff', padding: 24, margin: 0, minHeight: 280}}>
<div style={{width: 2000, background: 'red'}}>content</div>
</Content>
</Layout>
with style:风格:
.layout {
align-items: flex-start;
}
See updated codepen
.请参阅
updated codepen
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.