我想知道如何证明在justify-content: space-between中允许使用flexbox多少空间。
目前,我的项目是间隔的,但它们之间的空间太大了,我希望它们之间只有一点空间,这样它们就可以放置在中间的某处。
下面的代码片段有望澄清我正在努力解决的问题。
如果你需要我进一步澄清,请告诉我。谢谢!
#qwrapper {
display: flex;
height: 100%;
width: 100%;
align-items: center;
justify-content: center;
}
.row {
flex: 0 auto;
height: 100px;
margin: 0;
}
#lighticon {
padding-bottom: 30px;
}
@media (max-width: 800px) {
#qwrapper {
flex-direction: column;
align-items: center;
}
}
@media screen and (max-width: 480px) {
#qwrapper {
flex-wrap: wrap;
}
.row {}
}
@media only screen and (min-width: 760px) {
#qwrapper {
justify-content: space-between;
margin: 10px;
}
#lighticon {
position: relative;
margin-left: 100px;
}
}<div id="qwrapper">
<h3 id="michelle" class="row">"She always thinks of her clients."
<br>
</h3>
<img src="https://cdn4.iconfinder.com/data/icons/black-icon-social-media/512/099310-feedburner-logo.png" class="row" alt="" id="lighticon" />
<h3 id="jerry" class="row">"Very smart, creative person, problem solver."
<br>
</h3>
</div>
发布于 2019-03-01 04:13:01
我发现自己在所有的框中都添加了右边距(在本例中是三个)
.three {
margin-right: 2%
}然后去掉它,这样最后一个盒子就对齐了
.three:nth-child(3) {
margin-right: 0%;
}但每次我这样做的时候,我都在想“一定有更好的方法,一些烘焙到flex-box中的东西……这是可行的,但它看起来像是一种变通方法?”
https://stackoverflow.com/questions/42080123
复制相似问题