【发布时间】:2017-12-26 00:27:00
【问题描述】:
我创建了一个带有角材料的示例 Angular 4 应用程序。 我正在尝试将卡片置于视图的中心。 但它不起作用。下面是代码
app.component.html
<!--The content below is only a placeholder and can be replaced.-->
<router-outlet></router-outlet>
login.component.html
<div ng-cloak="" layout-fill layout="column" style="background:green" layout-align="center">
<div flex="50" layout="row" layout-align="center">
<md-card flex="50"></md-card>
</div>
</div>
login.component.ts
import { Component, OnInit } from '@angular/core';
import { MdCardModule,MdInputModule } from '@angular/material';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
【问题讨论】: