我尝试添加justify-content: space-between;,因此两个flex元素之间的空间是相等的。
div,在这两个项目中都是“粘在一起”的,在320px屏幕中没有空格与大小:http://imgur.com/a/QAYcy。856px屏幕上,没有空间被分配,http://imgur.com/a/y0iBp1364px屏幕上有空间分布,http://imgur.com/a/05tsj我正在尝试使用justify-content: space-between;分配空间。
有什么想法吗?
/* SECTION THREE */
.sec-3 {
background-color: #f1eeee;
margin-top: -22px;
}
.sec-3-flex {
background-color: red;
display: flex;
flex-direction: row-reverse;
align-items: center;
justify-content: space-around;
}
.sec-3-flex #iphone-2-img {
padding-top: 30px;
background-color: orange;
margin-right: -10%;
}
.sec-3-flex .sales-copy-wrap {
background-color: yellow;
}
#iphone-sec-3 {}<div class="sec-3">
<!-- iphone image -->
<div class="sec-3-flex">
<!-- Iphone 1 image -->
<picture id="iphone-sec-3">
<!-- <source media="(min-width: 320px)" srcset="img/mobile/mobile-iphone-1.jpg"> -->
<source media="(min-width: 320px)" srcset="img/desktop/images/home_11.jpg">
<img id="iphone-2-img" src="img_orange_flowers.jpg" alt="Flowers" style="width:50%">
</picture>
<div class="sales-copy-wrap">
<h3>Get organized with events, tasks and notes.</h3>
<p class="sales-copy">Now more then ever it is critical for smart professionals to stay up to date with important deadlines.</p>
</div>
</div>
</div>
发布于 2017-07-14 03:38:53
图像不是一个弹性项。它是flex (picture)的子类。
因此,在这个弹性项中,图像(自然)是对齐左边的。
将此添加到代码中:
picture {
text-align: right;
}https://stackoverflow.com/questions/45094132
复制相似问题