gpt4 book ai didi

twitter-bootstrap - Ant 设计 react 。 Bootstrap网格 "container"概念

转载 作者:行者123 更新时间:2023-12-03 13:22:15 24 4
gpt4 key购买 nike

Ant Design for React 中有 Bootstrap Grid “容器” 概念吗?

Containers are the most basic layout element in Bootstrap and are required when using our default grid system. Choose from a responsive, fixed-width container (meaning its max-width changes at each breakpoint) or fluid-width (meaning it’s 100% wide all the time).

While containers can be nested, most layouts do not require a nested container.

<div class="container">
<!-- Content here -->
</div>

最佳答案

Antd 在其网格系统中不提供容器。但您可以创建自己的容器类。

具体操作方法如下:

@import "~antd/lib/style/index";

.container {
width: 100%;
display: flex;
align-self: center;
margin: auto;
}

.make-container(@minWidth, @breakpoint) {
@media (min-width: @minWidth) {
.container {
max-width: @breakpoint;
}
}
}

.make-container(@screen-xs-min, @screen-xs);
.make-container(@screen-sm-min, @screen-sm);
.make-container(@screen-md-min, @screen-md);
.make-container(@screen-lg-min, @screen-lg);
.make-container(@screen-xl-min, @screen-xl);
.make-container(@screen-xxl-min, @screen-xxl); // Optional

然后你就可以像在 Bootstrap 中一样使用该类

<div class="container"></div>

关于twitter-bootstrap - Ant 设计 react 。 Bootstrap网格 "container"概念,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49596113/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com