html - ion-text-center 不将 ion-item 中的内容居中
问题描述
<ion-item lines="none" class="ion-text-center">
<ion-avatar slot="start" *ngFor="let mId of headerMemberIds;let i = index" class="member-{{i}}">
<img [src]="profilePhotoUrl$[mId] | async">
</ion-avatar>
<ion-avatar slot="start" class="avatar" *ngIf="allMemberIds?.length>3">
<div class="remaining-members">+{{allMemberIds?.length-2}}</div>
</ion-avatar>
</ion-item>
关于如何将内容集中在ion-item
上面的用例中,当然还有我的用例的任何线索?
在浏览器上生成的 css
.ion-text-center, [text-center] {
text-align: center !important;
}
解决方案
您应该使用 class="text-center" 并像这样定义类:
.text-center {
text-align: center;
}
推荐阅读
- android - 如何使用 android room 解决孤岛/间隙问题?
- c++ - 将文件中的数据复制到指针向量中
- awk - ZGrep 模式*after* 给定行的第一次出现
- azure-devops - 尝试部署到 azure devops 管道中的 azure 资源时出现权限错误
- xslt - 如何使用 XPATH 创建包含特定次数的固定值的序列?
- tensorflow - keras 模型拟合:ValueError:找不到可以处理输入的数据适配器:
, - ios - NSUserTrackingDescription 失败
- swiftui - 更改单行的视图背景颜色
- graph - 所需的最小线条长度
- visual-studio-code - 您可以在 Visual Studio Code 的命令面板中创建复选框吗