如何将mat-h orizo ntal-stepper保持在页面中心

问题描述 投票:0回答:1

enter image description here我正在使用Angular 6 mat-h​​orizo​​ntal-stepper。我想给它一些特定的宽度,并希望将它保持在页面的中心。对于mat-h​​orizo​​ntal-content-container,我可以将它保持在中心位置

.mat-horizontal-content-container 
    text-align: center;
    overflow: hidden;
    padding: 0;

但是如何将标题保持在页面的中心。我正在尝试这个但它不起作用。

.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container 
    width: fit-content !important;
    align-items: center;

任何人都可以帮我这个。

css angular angular6 angular-material-6 mat-stepper
1个回答
0
投票

深入尝试

  /deep/.mat-horizontal-content-container {
        text-align: center;
        overflow: hidden;
        padding: 0;
    }

因为深度将很快弃用,所以可以在style.css中的全局css文件中编写样式

© www.soinside.com 2019 - 2024. All rights reserved.