gpt4 book ai didi

html - 更改 div 与背景图像之间的 flex 间距

转载 作者:行者123 更新时间:2023-11-28 16:58:45 26 4
gpt4 key购买 nike

嗨,我正在重新制作 google chrome 主页,但我似乎无法完成页面底部的部分,因为最常用的应用程序是我正在尝试使用 display flex 来完成它,因为它是内联的,但我无法获得此处的间距不均匀或大或小是我想要的样子... enter image description here

这是我得到的

enter image description here enter image description here enter image description here最上面的是我需要得到的。注意间距太小在中间它太大了,我正在寻找它恰到好处证明内容似乎不影响间距?这是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);


}
.rowCell{
justify-content: space-around;
align-items: center;
position: relative;
background-repeat: no-repeat;
width: 200px;
height: 150px;
margin-top: -589px;
left: 422px;
}
.mostUsedApps{
width: 42%;
display: flex;
justify-content: space-between;
justify-content: space-around;
align-items: center;
}

这是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>

非常感谢任何帮助,谢谢:)

最佳答案

如果您的图标大小相同,那么您只需要父级 div 上的 justify-content 属性,即 "mostUsedApps" .

如果它们的大小不同,那么您需要提供指向 codepen 或 codesandbox 的链接,否则将很难提供帮助。

关于html - 更改 div 与背景图像之间的 flex 间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54749563/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com