简体   繁体   English

angular-material2工具栏阴影

[英]angular-material2 toolbar shadow

I am new to material2 I am trying to keep the the main app toolbar fixed on the top of the screen the problem is that the elevation is not working correctly (the content hides the drop shadow of the toolbar) I Here is my HTML code 我是材料2的新手我试图将主应用工具栏固定在屏幕顶部,问题是高程不正常(内容隐藏了工具栏的阴影)我这是我的HTML代码

.app-content {
  height: calc(100% - 64px);
  overflow: auto;
}
<md-toolbar class="mat-elevation-z5" color="primary" style="z-index: 100!important;">

  <button md-icon-button (click)="start.open()">
      <md-icon class="demo-toolbar-icon">menu</md-icon>
    </button>
  <span>E-Learning</span>

  <span class="demo-fill-remaining"></span>
</md-toolbar>
<div class="app-content" style="z-index: 0!important;">
  <div class="workspace">
    <el-teacher></el-teacher>
  </div>
</div>

在此输入图像描述

You have to provided position relative/absolute/fixed/static to your element to get z-index working. 您必须为元素提供位置相对/绝对/固定/静态以使z-index工作。

.mat-elevation-z5 {
   position: relative;
   z-index: 2;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM