我在我的项目中使用AngularJS Material datepicker,我正在使用一些自定义CSS,md-datepicker
不幸忽略了。
这是一个片段:
angular.module('myApp',['ngMaterial'])

body{background-color:white}
.datePicker{
margin-top:100px;
}

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Angular Material style sheet -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
</head>
<body ng-app="myApp" >
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-messages.min.js"></script>
<!-- Angular Material Library -->
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script>
<label>User Date</label><br>
<md-datepicker ng-model='userDate' class="datePicker md-primary"></md-datepicker>
</body>
&#13;
答案 0 :(得分:1)
它正在占用,但display
不对。为display
设置正确的<md-datepicker>
:
.datePicker {
margin-top: 100px;
display: block;
}
预览强>