【发布时间】:2019-12-07 22:14:34
【问题描述】:
很好奇,如果您的 flexbox 专家有时间帮助这个布局(如果有必要也可以使用 Grid,但我认为这应该可以通过 flexbox 实现)。
这些年的自力更生已经使我的大脑适应了条件,我需要重新训练它。
这是我目前所拥有的,仍在搞砸。
我有什么: 已放置徽标并将统计信息部分拉到右侧,但我无法弄清楚如何将其正确放入列中。
想要的结果
<mat-toolbar>
<div class="company-logo"></div>
<div class="stats">
<div class="stats-one">
Info 1: XXX
Info 2: XXX
</div>
<mat-divider [vertical]="true"></mat-divider>
<div>
Info 3: XXX
Info 4: XXX
</div>
</div>
</mat-toolbar>
.mat-toolbar {
display: flex;
align-items: stretch;
height: 5em;
background-color: #4CAEB2;
margin-bottom: 2em;
}
.company-logo {
align-self: flex-end;
background-image: url("../../../assets/images/logo.jpg");
background-repeat: no-repeat;
height: 4em;
flex-basis: 20em;
}
.stats {
display: flex;
flex-direction: column;
margin-left: auto;
color: white;
}
【问题讨论】: