gpt4 book ai didi

Css Flex/Start end/aligning 3个组件

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

您好,我需要一个具有 3 个对齐方式的按钮

左边一个图标div中间一个按钮,最后一个按钮

    <Content>
<Image src = { logo } style = {{width:'50px'}}/>
<Button />
<Button />
</Content>

CSS:

export const wrapStyle = css`
min-height: 55px;
max-height: 55px;
width:100%;
background: yellow;
padding: 0 !important; `;

export const contentLogo = css`
width:240px;
height:100%;
background-color: rgba(31,30,30,.12)!important;
line-height: 52px;
padding-left: 20px;
padding-right: 20px;
display: flex;
align-items: center;
position: relative;
transition: all .3s; `;

像这样:

enter image description here

我相信最好的方法是使用 flex end start 等

我试过了,但是不行

最佳答案

像这样

body {
margin: 0;
}

#container {
display: flex;
justify-content: space-between;
align-items: center;
background: purple;
padding: 1rem;
}

.flex-item {
color: #fff;
}
<div id="container">
<div class="flex-item"> Item One </div>
<div class="flex-item"> <h1>Item Two</h1> </div>
<div class="flex-item"> Item Three </div>
</div>

关于Css Flex/Start end/aligning 3个组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59688117/

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