ユーザー名とパスワードの入力と、ボタンとハイパーリンクの入力があるログインページを作成しました。 私は水平方向と垂直方向の両方でイオンの内容全体を画面の中心に配置したいと考えています。ION 2/3の画面の中央にイオン含有量のコンテンツをレンダリングする
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>
あなたはそれを達成するためのいくつかの他の方法を提案することができます。出力は非常に敏感でなければなりません。
画面の中央にすべて水平に整列させてください。私のシナリオでは、フレックス方向はカラムタイプにしてください。 –
ああ、そうです。私はあなたのコメントで答えを更新しました。 – sebaferreras
画面の一番上に合わせる。中央にしない。 –