Mat-Nav-List horizontal instead of vertical?

前端 未结 7 992
没有蜡笔的小新
没有蜡笔的小新 2021-02-07 23:18

How do I make the following horizontal instead of the (apparent default) of vertical? It is located within navigation.component.html within my Angular 5.2.7 application that wa

7条回答
  •  天涯浪人
    2021-02-07 23:51

    I was able to create a horizontal mat-nav-list by using some custom scss. I attach it using the class list-horizontal.

    
      ...
    
    

    Here's the scss I used for list-horizontal:

    mat-nav-list.list-horizontal {
      padding: 0;
      .mat-list-item {
        display: inline-block;
        height: auto;
        width: auto;
      }
    }
    

    Here's a Stackblitz to show it working with Angular Material 7.

提交回复
热议问题