我使用ionic4创建了一个登录表单,该表单为我提供了一个浮动文本行来输入登录凭据。
<ion-content>
<ion-title class="ion-text-center" >Login</ion-title>
<ion-item>
<ion-label position="floating" >Email Id</ion-label>
<ion-input type="text" ></ion-input>
</ion-item>
<ion-item>
<ion-label position="floating" >Password</ion-label>
<ion-input type="password" ></ion-input>
</ion-item>
<ion-text color="tertiary"><h6>Forgot Password?</h6></ion-text>
<div class="login-btn">
<ion-button class="login-button" expand="full">Login</ion-button>
</div>
<div class="not-a-member">
<ion-text>Not a member yet? </ion-text><ion-text color="tertiary"> Sign-Up</ion-text>
答案 0 :(得分:2)
尝试以下代码:
<div style="margin: 10px;">
<ion-input type="email" placeholder="Email" [(ngModel)]="email" style="text-align: center; border: skyblue solid 0.5px;"></ion-input>
</div>
<div style="margin: 10px;">
<ion-input type="password" placeholder="Password" [(ngModel)]="password" style="text-align: center; border: skyblue solid 0.5px;"></ion-input>
</div>