HTMLテンプレートのng2-flex-layout内に画像を含む2つのdivがあります。これらのdivの1つをページの左端に、もう1つをページの右端に配置したいと思います。
私のコード:
<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"
が、影響はありません。
誰か助けてもらえますか?
まず、 flex-layoutにはAngularv2.4.3以降が必要です。その依存関係を満たしていることを確認してください。
2番目:このコードはあなたが求めている結果をレンダリングします。fxLayout="row"
そしてfxLayoutAlign="space-between center"
あなたにflex-container
そしてあなたの子供にタグを付けるflex-item
ことはあなたが必要とするすべてです。
<div class="flex-container"
fxLayout="row"
fxLayoutAlign="space-between center">
<div class="flex-item">
<img src="https://codepo8.github.io/canvas-images-and-pixels/img/horse.png" />
</div>
<div class="flex-item">
<img src="https://codepo8.github.io/canvas-images-and-pixels/img/horse.png" />
</div>
</div>
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加