首页 > 解决方案 > Consistent Height on Angular material tabs

问题描述

Scenario:

I have a angular material tabs with two tab inside. Each tab has different height. I need to set the overall height of the tab with the highest height out of the two tabs.

Issue:

The height is not consistent.

enter image description hereenter image description here

How to make the height of the second tab same as first one which is always dynamic?

Sample Code that I have used it in my project:

<mat-tab-group dynamicHeight>
  <mat-tab label="Short tab">
    <div class="example-small-box mat-elevation-z4">
      Small content
    </div>
  </mat-tab>
  <mat-tab label="Long tab">
    <div class="example-large-box mat-elevation-z4">
      Large content
    </div>
  </mat-tab>
</mat-tab-group>

标签: angularangular-material

解决方案


推荐阅读