本文介绍了移除 Material Stepper 头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想去掉材质步进器上的标题导航.请建议我该怎么做?我尝试设置以下 css,但似乎没有用:

.mat-h​​orizo​​ntal-stepper-header-container{display: none}

这是步进器的 stackblitz 链接.

解决方案

你需要结合使用 ::ng-deep 来绕过 shadow DOM 和 !important标志绕过材料自己的样式:

::ng-deep .mat-h​​orizo​​ntal-stepper-header-container {显示:无!重要;}

I want to get rid of the header navigation on the material stepper. Please suggest how can I do it?I tried setting the following css but didn't seems to work:

.mat-horizontal-stepper-header-container{display: none}

Here is stackblitz link of the stepper.https://stackblitz.com/edit/angular-material2-beta-ybbnhe?file=app%2Fapp.component.html

解决方案

You need to use a combination of ::ng-deep to get around shadow DOM and the !important flag to get around Materials own stylings:

::ng-deep .mat-horizontal-stepper-header-container {
  display: none !important;
}

这篇关于移除 Material Stepper 头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 08:33