【发布时间】:2025-11-29 05:25:01
【问题描述】:
我的 html 模板中的 ng2-flex-layout 中有 2 个 div,其中包含图像。我希望其中 1 个 div 位于页面的最左侧,另一个位于页面的最右侧。
我的代码:
<div class="flex-container"
fxLayout="row"
fxLayout.md="column"
fxLayout.sm="column"
fxLayout.xs="column"
fxLayoutAlign="space-between center">
<div class="flex-item" fxLayoutAlign="left" fxFlex=50> <img></img></div>
<div class="flex-item" fxFlex=50><img></img></div>
</div>
我正在使用"@angular/flex-layout": "^2.0.0-beta.4",
我尝试了layout-align="space-between center",但没有影响。
有人可以帮忙吗?
【问题讨论】:
-
你得到了什么结果,这段代码的容器是什么样子的?
-
我在左边得到一个图像,在中间得到一个图像......换句话说,每个 div 的左边都有一个图像。
标签: javascript html css angular flexbox