Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove bottom border of tab group

I want to remove the bottom border of the tabs group which in the image below is gray.

enter image description here

Here is a sample project to show of the code:

https://stackblitz.com/edit/angular-tabs-remove-bottom-border

like image 361
Johannes Kraft Avatar asked Dec 11 '22 02:12

Johannes Kraft


2 Answers

The border can be found on the .mat-tab-header class.

In your main.css file (or main.scss, styles.css or styles.scss), you can globally define

.remove-border-bottom .mat-tab-header {
    border-bottom: none;
}

And in your HTML file, give the mat-tab-group a class.

<mat-tab-group class="remove-border-bottom">
    <!-- ... -->
</mat-tab-group>

Due to encapsulation, if you want to define the style in your component.scss file, you have to use ::ng-deep:

.remove-border-bottom ::ng-deep .mat-tab-header {
    border-bottom: none;
}
like image 179
Julien Ambos Avatar answered Jun 04 '23 11:06

Julien Ambos


Use this and choose color of your bg :

::ng-deep .mat-tab-group.mat-primary .mat-ink-bar, .mat-tab-nav-bar.mat-primary .mat-ink-bar {
  background-color: white; // add styles properties here
}
like image 21
Naman Mittal Avatar answered Jun 04 '23 09:06

Naman Mittal