简体   繁体   中英

How to stop content scrolling over mat-tabs, when tabs are fixed

I need mat-tabs to stick to the top, I went through this Stackoverflow anwser , and fixed the tabs on top by adding this to the css:

:host ::ng-deep .mat-tab-header {
   position: fixed;
}

This works for fixing the tabs but, now the content flows over the tabs. Is there a way to fix this?

Stackblitz link for the problem . Please let me know if there is another way to stick the tabs on top or make the content not scroll on to the tabs.

Thank you.

You can just add background color + z-index: 1111 if I understood your question correctly.

:host ::ng-deep .mat-tab-header {
   position: fixed;
   background: white;
   z-index: 1111;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM