angular - 角度弹性布局未正确换行
问题描述
我们有一个 Angular 站点,仪表板上有多个部分。在全屏上,它们显示为 2 列。右列正确显示,没有间隙,但当右侧的框太大时,左列有间隙。我附上了一个显示差距的plunkr。我尝试了多种配置,但似乎无法让左列与右列一样工作。确保将预览扩大到有 2 列。
模板.html
<head>
</head>
<body>
<div>
<h2>Hello {{name}}</h2>
</div>
<div id="wrapper">
<!-- Main page wrapper -->
<div id="page-wrapper" class="gray-bg">
<!-- Main view/routes wrapper-->
<div class="wrapper wrapper-content">
<div class="row">
<div class="content" fxLayout="row" fxLayout.xs="column">
<div fxFlexOrder="0">
<div class="col-sm-6 sec1">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Box 1 Title</h5>
</div>
<div class="ibox-content text-center">
<h2>Box 1 content</h2>
<h2>Box 1 content</h2>
</div>
<div class="ibox-footer text-center">
<h4>box footer </h4>
</div>
</div>
</div>
</div>
<div fxFlexOrder="1">
<div class="col-sm-6 sec2">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Box 2 Title</h5>
</div>
<div class="ibox-content text-center">
<h2>Box 2 content</h2>
</div>
<div class="ibox-footer text-center">
<h4>box footer </h4>
</div>
</div>
</div>
</div>
<div fxFlexOrder="2">
<div class="col-sm-6 sec3">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Box 3 Title</h5>
</div>
<div class="ibox-content text-center">
<h2>Box 3 content</h2>
</div>
<div class="ibox-footer text-center">
<h4>box footer </h4>
</div>
</div>
</div>
</div>
<div fxFlexOrder="3">
<div class="col-sm-6 sec4">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Box 4 Title</h5>
</div>
<div class="ibox-content text-center">
<h2>Box 4 content</h2>
</div>
<div class="ibox-footer text-center">
<h4>box footer </h4>
</div>
</div>
</div>
</div>
<div fxFlexOrder="5">
<div class="col-sm-6 no-padding sec5">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Box 5 Title</h5>
</div>
<div class="ibox-content text-center">
<h2>Box 5 content</h2>
<h2>Box 5 content</h2>
</div>
<div class="ibox-footer text-center">
<h4>box footer </h4>
</div>
</div>
</div>
</div>
<div fxFlexOrder="6">
<div class="col-sm-6 sec6">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>Box 6 Title</h5>
</div>
<div class="ibox-content text-center">
<h2>Box 6 content</h2>
</div>
<div class="ibox-footer text-center">
<h4>box footer </h4>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End wrapper-->
</div>
</body>
</html>
css
.sec1 {
background: red;
color:white;
text-transform: uppercase
}
.sec2 {
background: yellow;
color:blue;
}
.sec3 {
background: blue;
color:white;
text-transform: uppercase
}
.sec4 {
background: green;
color:white;
text-transform: uppercase
}
.sec5 {
background: purple;
color:white;
text-transform: uppercase
}
.sec6 {
background: orange;
color:white;
text-transform: uppercase
}
解决方案
推荐阅读
- algorithm - 如何使用R使用for循环查找变量的总和
- angular - 单选按钮打开 2 次点击
- c# - 如何在静态泛型方法中为 T 设置默认类型?
- python - 如何在 django rest API 中向路由器提供参数?
- google-chrome - Chrome 80:DevTools 未聚焦时暂停脚本执行 (F8) 不起作用
- azure-logic-apps - 逻辑应用程序 - 停止在周末运行的 Blob 触发器
- go - 如何将大师与 Visual Studio 代码集成?
- react-native - 在登录状态后对原生 redux 做出反应,在渲染之前没有更新
- javascript - 我想知道我可以在一条路线中读取两个 json 文件吗?
- elasticsearch - 访问 ElasticSearch2.4.3 集群环境的 URL