我正在尝试建立一个聚合物网站,我想知道如何将 iron-image 元素设置在中心

I am trying to build a polymer site and I am wondering how to set the iron-image element at the center

这是我的代码

<iron-image style="width:500px; height:400px; background-color: lightgray;"
    sizing="cover" preload fade src="images/1.jpg"></iron-image>
<iron-image style="width:500px; height:400px; background-color: lightgray;"
    sizing="cover" preload fade src="images/2.jpg"></iron-image>

这是代码的输出,我想把它放在中间:

使用 iron-flex-layout

<custom-style>
  <style is="custom-style">
    .flex-center-justified {
      @apply --layout-horizontal;
      @apply --layout-center-justified;
    }
  </style>
</custom-style>

<div class="container flex-center-justified">
  <iron-image style="width:500px; height:400px; background-color: lightgray;"
    sizing="cover" preload fade src="images/1.jpg"></iron-image>
  <iron-image style="width:500px; height:400px; background-color: lightgray;"
    sizing="cover" preload fade src="images/2.jpg"></iron-image>
</div>