css位置固定z索引不工作

css位置固定z索引不工作,css,twitter-bootstrap,angular-ui-bootstrap,Css,Twitter Bootstrap,Angular Ui Bootstrap,我使用的是ui引导数据采集器,我用位置:fixed定制了它的样式。我面临的问题是,当OpenDatePicker出现在后台时,有没有办法解决这个问题。我尝试过使用z-index 这是最新的 添加以下代码将解决您的问题 .dropdown-menu[datepicker-popup-wrap]:before { content: ''; position: fixed; z-index: -1; top: 0; left: 0; right: 0; bottom: 0

我使用的是ui引导数据采集器,我用
位置:fixed
定制了它的样式。我面临的问题是,当OpenDatePicker出现在后台时,有没有办法解决这个问题。我尝试过使用
z-index

这是最新的



添加以下代码将解决您的问题

.dropdown-menu[datepicker-popup-wrap]:before {
  content: '';
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.3);
}

检查这里的演示:

这正是我的解决方案,但它仍然在背景下,即周和日的名称,可以解决吗?这就是背景色问题。谢谢你抽出时间
var app = angular
    .module('myApp', ['ui.bootstrap', 'ngAnimate', 'ngAria', 'ngMaterial'])
    .controller('myController', function ($scope, $modal) {
      $scope.showModal = function () {
        var modalInstance;
        modalInstance = $modal.open({
          templateUrl: "addNew.html",
          controller: 'myController2',
          size: 'lg'
        });
      };
      $scope.showModal();
    })
    .controller('myController2', function ($scope, $modal) {
      $scope.datepickers = {
        start: false
      }

      $scope.openDatepicker = function ($event, which) {
        $event.preventDefault();
        $event.stopPropagation();
        $scope.datepickers[which] = true;
      };

      $scope.dateOptions = {
        formatYear: 'yy',
        startingDay: 1
      };

      $scope.dateFormat = 'mediumDate';
    });
md-tab-content {
  min-height: 300px;
}
md-tab-content.md-no-scroll {
    overflow: auto;
}
.dropdown-menu[datepicker-popup-wrap] {
  position: fixed;
  top: 50% !important;
  left: 50% !important;
  margin-left: -150px;
  margin-top: -145px;
}
.dropdown-menu[datepicker-popup-wrap]:before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.3);
}
.dropdown-menu[datepicker-popup-wrap]:before {
  content: '';
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.3);
}