【发布时间】:2019-10-30 23:15:20
【问题描述】:
我想知道如何证明在 justify-content: space-between 中允许有多少空间用于 flexbox。
目前,我的物品是隔开的,但它们之间的空间太大,我希望它们之间有一点空间,这样它们就可以连续放置在中间的某个地方。
下面的 sn-p 有望阐明我正在努力解决的问题。
如果您需要我进一步澄清,请告诉我。谢谢!
#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>
【问题讨论】:
-
试试 justify-content: space around;弹性项目的左边距。
-
也许在 flex 父节点上使用
justify-content: center;并在img上使用margin: 0 50px;?