为什么图像垂直显示而不是水平显示

时间:2018-03-20 12:25:59

标签: html css

为什么图像垂直显示?我在 span 中的中有两个图像,而不是div,但它们是一个在另一个下面显示的,如果有足够的空间,我希望它们显示在彼此旁边。

.largeartwork img {
  max-width: 300px;
  max-height: 300px;
  min-width: 300px;
  min-height: 300px;
  border: 5px solid red;
  display: inline-block;
}
<span class="largeartwork">
        <figure>
            <img src="images/RhptaKqkpmMJ6w-Y7iJHqg==.jpg">
            <figcaption>
                Current Image
            </figcaption>
        </figure>
        <figure>
            <img src="images/7xZ_CPneKuf6IRuYp4omnQ==.jpg">
            <figcaption>
                Current Image
            </figcaption>
        </figure>
    </span>

1 个答案:

答案 0 :(得分:1)

使用display:flex

$a = {
  content: "Lorem ipsum",
  created_at: "2018-03-13 16:51:21",
  deleted_at: null,
  group_id: 1,
  rating: 6,
  updated_at: "2018-03-13 16:51:21",
  user_id: 1
}

$a['user'] = User::find($a['user_id']);


you will get

{
      content: "Lorem ipsum",
      created_at: "2018-03-13 16:51:21",
      deleted_at: null,
      group_id: 1,
      rating: 6,
      updated_at: "2018-03-13 16:51:21",
      user: {
        name: "John",
        surname: "Doe",
        avatar: "file.jpg"
      }
}