将div插入偶数空格

时间:2019-02-18 08:37:16

标签: html css

您好,我正在尝试重新制作google主页,除Google页面底部是最常用的应用程序外,我已经完成了大部分操作

enter image description here

这就是我想要的,但是当我使用inline block时我会得到

enter image description here

我在Google各处看过,但找不到适合背景图片的图片。

这是我的HTML

<div class='mostUsedApps'>
  <div class='youtube rowCell'></div>
  <div class='facebook rowCell'></div>
  <div class='roblox rowCell'></div>
  <div class='Agar rowCell'></div>
  <div class='gmail rowCell'></div>
</div>

这是我的CSS

.youtube{
  background-image: url(youtube.png);
}

.facebook{
  background-image: url(facebook.png);
}

.roblox{
  background-image: url(roblox.png);
}

.Agar{
  background-image: url(Agar.png);
}

.gmail{
  background-image: url(gmail.png);
}

.trading{
  background-image: url(lernforex.png);
}

.trading1{
  background-image: url(lernforex.png);
}

.wordpress{
  background-image: url(wordpress.png);
}

.onlinegames{
  background-image: url(onlinegames.png);
}

.spredsheet{
  background-image: url(spredsheet.png);
}

.rowCell{
  width: 50px;
  height: 61px;
  position: relative;
  display: inline-block;
  background-repeat: no-repeat;
}

您知道如何使用inline-block或任何其他显示器来复制第一张图像吗?非常感谢任何帮助,谢谢:)

1 个答案:

答案 0 :(得分:1)

您应该尝试使用flex,完整的指南:https://css-tricks.com/snippets/css/a-guide-to-flexbox/

.mostUsedApps {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
相关问题