【发布时间】:2017-12-16 15:04:16
【问题描述】:
我创建了一个登录页面,其中包含用户名和密码输入,然后是按钮和超链接。 我想将整个离子含量水平和垂直放置在屏幕中心。
ion-content {
position: absolute;
top: 50%;
left: 0%;
right: 50%;
margin: 0 auto;
margin-top: 0;
margin-left: 0;
}
// .div1 {
// position: absolute;
// background-color: green;
// top: 0;
// left: 0;
// right: 0;
// bottom: 0;
// display: block;
// width: 100%;
// height: 100%; // contain: layout size style;
// }
// // .Absolute-Center {
// // margin: auto;
// // position: absolute;
// // top: 0; left: 0; bottom: 0; right: 0;
// // }
// div {
// position: absolute;
// top: 0;
// bottom: 0;
// left: 0;
// right: 0;
// margin: auto;
// width: 100%;
// height: 100%;
// background-color: transparent;
// }
<ion-header>
<ion-navbar>
<ion-title>login</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-item>
<ion-label floating>User Name</ion-label>
<ion-input [(ngModel)]="user.username" type="text" style="background-color:transparent"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input [(ngModel)]="user.password" type="password"></ion-input>
</ion-item>
<button padding (click)="homePage()" color=secondary ion-button full round>Login</button>
<a (click)="registerPage()">New ? Register here</a>
</ion-content>
您能否建议一些其他方法来实现它。输出应该非常灵敏。
【问题讨论】:
标签: html css sass ionic2 ionic3