hi i am remaking the google chrome home page but i cant seem to do the part at the bottom of the page were the most used apps are i am trying to do it with display flex because it puts it inline but i cant get the spacing right its uneven or to big or small here is what i want it to look like...
and here is what i get
the top one is what i need to get. notice that the spacing is to small and in the middle its to big i am looking for it to be just right justify-content doesn't seem to effect spacing? here is the 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;
}
here is the 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>
Any help is much appreciated,thanks :)
If your icons are of same size, then you would just need the justify-content
property on your parent div i.e. "mostUsedApps".
If they are of different size, then you would need to provide a link to codepen or codesandbox, without that it would be difficult to help.
来源:https://stackoverflow.com/questions/54749563/change-the-flex-spacing-between-div-with-background-image