gpt4 book ai didi

html - flex 1 :1 is not working with Ionic grid. 我需要分配空间 50:50

转载 作者:行者123 更新时间:2023-11-28 15:07:38 24 4
gpt4 key购买 nike

.scss

.content {
ion-grid {
height: 100% !important;
}
.row1 {
flex: 1 !important;
}
.row2 {
flex: 1 !important;
}
}

.html

<ion-content class="content">
<ion-grid>
<ion-row class="row1">
<ion-col size="12">
S-Works Venge Disc – SRAM eTAP
</ion-col>
</ion-row>
<ion-row class="row2">
<ion-col size="12">
<ion-row>
<ion-col size="12">
S-Works Venge Disc – SRAM eTAP
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12">
Availability : Upon Request
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12">
About
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12">
We aren't satisfied with second fastest. Hello, why do you think we have our own Win Tunnel and the motto,
"Aero is Everything?" We live and breathe aero, because we know that aerodynamic optimization is the best
thing we can do to make you faster. And this philosophy has never been truer than with the new Venge. Being
eight seconds faster than the ViAS, it’s not only the most aerodynamic bike on the road, but it’s also lost
460 grams. And now with SRAM RED eTAP, you’re definitively looking at the new shape of speed.
</ion-col>
</ion-row>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>

结果:

enter image description here

问:您能告诉我为什么在上述设计中我看不到 50:50 空间分配吗?

最佳答案

要使 flex: 1 属性起作用,其父级必须具有属性 display: flex默认情况下,display: flex 在一行中显示其子项,这就是我们需要将方向更改为列的原因

ion-grid {
display: flex;
flex-direction: column;
height: 100% !important;
}

关于html - flex 1 :1 is not working with Ionic grid. 我需要分配空间 50:50,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55042540/

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