gpt4 book ai didi

html - CSS : Align items in flex layout

转载 作者:太空宇宙 更新时间:2023-11-04 00:57:44 25 4
gpt4 key购买 nike

我希望向下箭头位于页面的底部中央。我试图通过 flex 布局来实现这一点。但到目前为止无法做到。有人可以帮帮我吗 ?下面是我的 css/html

.flex-description-container {
display: flex;
flex-flow: row wrap;
align-items: center
}

.flex-item-descriptionText {
padding: 10px;
color: white;
font-weight: bold;
font-size: 4em;
text-align: center;
flex: 1;
}

.flex-item-descriptionImage {
padding: 10px;
color: white;
flex: 1;
}

.flex-item-next {
flex: 1 100%;
align-items: center;
align-self: flex-end;
justify-content: center;
}

应用程序.jsx>

<Parallax.Layer
offset={0} speed={0}
onClick={() => this.parallax.scrollTo(1)}>
<div class="flex-description-container ">
<div class="flex-item-descriptionText">Text </div>
<div class="flex-item-descriptionImage">
<img src={url('desk')} style={{ width: '50%' }} />
</div>
<div class="flex-item-next">
<img src={url('down')} style={{ width: '5%' }} />
</div>
</div>
</Parallax.Layer>

enter image description here

PS:我正在使用这个 react component

最佳答案

只需将 display:flex 添加到 .flex-item-next 即可。

.flex-item-next {
flex: 1 100%;
display: flex;
align-items: center;
align-self: flex-end;
justify-content: center;
}

参见 working implementation .

关于html - CSS : Align items in flex layout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54167236/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com