【发布时间】:2021-07-23 01:58:11
【问题描述】:
我目前有这个部分,但它们并没有真正对齐。我想让每个元素与它旁边的元素对齐。
正如您在上面看到的,图标、标题和描述没有对齐,因为它受图标的影响。
下面是我的代码:
<div class="steps-icons">
<div class="steps-icons-section steps-icons-first">
<img src="{{media url=wysiwyg/landing_page/how_it_works/You_Pick_It_Icon.png}}" alt="You pick it" />
<h6> You Pick It </h6>
<p> Select a box option based on your craving </p>
</div>
<div class="steps-icons-section steps-icons-second">
<img src="{{media url=wysiwyg/landing_page/how_it_works/We_Build_It_Icon.png}}" alt="We build it" />
<h6> We Build It </h6>
<p> We create your box with the names and flavors you love </p>
</div>
<div class="steps-icons-section steps-icons-third">
<img src="{{media url=wysiwyg/landing_page/how_it_works/Delivered_Icon.png}}" alt="Delivered Icon" />
<h6> Delivered </h6>
<p> No more runs to the gas station or over paying </p>
</div>
</div>
CSS
/* How it works */
.steps-icons {
display: flex;
display: -moz-box;
display: -ms-flexbox;
align-items: center;
justify-content: center;
}
@media (max-width: 768px) {
.steps-icons {
flex-direction: column;
display: block;
}
}
.steps-icons-section {
flex: 1;
margin: 20px 20px 20px;
padding: 20px 20px 20px;
text-align: center;
}
【问题讨论】:
标签: html css icons vertical-alignment