gpt4 book ai didi

css - 设计 SAAS 我想要 Box 布局但无法得到它

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

就像我试图得到这个布局 enter image description here

<div>
{iconElement}
<div className='id-count-title'>
{title}
<div className='id-count-description'>
{description}
</div>
</div>
</div>

我尝试编写 CSS 并为其添加样式,

.id-count-title {
width: 37px;
height: 32px;
left: 443px;

font-family: Open Sans;
font-style: normal;
font-weight: bold;
font-size: 32px;
text-align: center;

color: #4CA6EA;
}

.id-count-description {
width: 58px;
height: 16px;
left: 432px;
font-family: Open Sans;
font-style: normal;
font-weight: normal;
line-height: 16px;
font-size: 11px;
text-align: center;
}

通过这个样式类,我得到了 enter image description here

如何实现所需的样式?

最佳答案

使用flexbox,这里是flexbox的使用指南:https://css-tricks.com/snippets/css/a-guide-to-flexbox/ .

让您的容器display: flexjustify-content: space-aroundspace-between 为您喜欢的。

.flex {
display: flex;
justify-content: space-around;
background: #135;
padding: 10px;
color: #fff;
text-align: center;
}

.flex span {
font-size: 24px;
display: block;
}

.flex .active {
color: #4CA6EA;
}
<div class="flex">
<div class="active"><span>18</span>Users</div>
<div><span>1</span>Native</div>
<div><span>17</span>Non-native</div>
</div>

关于css - 设计 SAAS 我想要 Box 布局但无法得到它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55016909/

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