【发布时间】:2020-05-05 04:04:31
【问题描述】:
我正在尝试将图标与 Ionic (React) 中的中心对齐。但如屏幕截图所示,图标粘在左侧:
多伦多证券交易所代码:
type WalletBtnProps = {
icon: { ios: string; md: string };
label: string;
};
class WalletBtn extends React.Component<WalletBtnProps> {
render() {
return (
<div className="wallet-button ion-text-center">
<IonIcon icon={this.props.icon} />
<IonLabel>{this.props.label}</IonLabel>
</div>
);
}
}
CSS:
.wallet-button {
width: 100%;
text-align: center;
height: auto;
background: rgba(190, 164, 164, 0.2);
border-radius: 10px;
padding: 15px;
}
.wallet-button * {
display: block !important;
}
.wallet-button ion-icon {
font-size: 64px;
}
关于如何解决此问题的任何建议?
【问题讨论】:
标签: css reactjs typescript ionic-framework ionic4