[Tabs] Md-tab height: 100% does not give all height of group
See original GitHub issueHi,
I’m having problems to adjust content of a tab to 100% of height of md-tab-group
For example:
<md-tab-group style="background-color: lightblue; height: 100%">// this works all bk is blue
<md-tab label="Info" style="background-color: indianred; height: 100%">//not work
<div style="background-color: yellow; height: 100%"></div>//with % not work, with px works
</md-tab>
</md-tab-group>
My problem is that md-tab-group
expands his height
to total of height
. But the atribute height
of md-tab
doesn’t fit to 100% of md-tab-group
.
Because of that the content, even if I set the height to 100% it doesn’t fit to 100% of height
If I set thet height
attribute of the <div>
to for example 500px it works correctly
I have this problem since I added <!doctype html>
to my index.html
Versions: Beta.5 Angular 4
What would be doing wrong?
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (8 by maintainers)
Top Results From Across the Web
md-tab doen't accept height=100% to give all ... - Stack Overflow
EDIT: My problem is that md-tab-group expands his height to total of height . But the atribute height of md-tab doesn't fit to...
Read more >max-height - CSS: Cascading Style Sheets - MDN Web Docs
The max-height CSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger ......
Read more >Tab group with dynamic height based on tab contents
Tab group with dynamic height based on tab contents.
Read more >CSS Trick: Tabs with consistent height - Observable
Sometimes you will have tabs with content of similar but not equal height, ... You might be tempted to just set a fixed...
Read more >Fill Angular Material 2 tab with flex-layout - iTecNote
While you had html / body set to 100% , <material-app> was not expanding to the full height. Using :host { min-height: 100vh;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I played around with this some more, my previous idea with absolute positioning broke the dynamic-tab-height implementation. The only way I’ve gotten this to work so far is by making all the child tab body containers flex. Adding
The important flag on the .mat-tab-body is to override the display: block style already existing on that class, obviously the real fix would replace the display: block and !important would not be needed. This also seems to fix the issue @KeTr uncovered using a ‘p’ element.
I also changed the inner div style from: height: 100% to: flex-grow: 1. plunk has been updated, tested on a Mac with OSX v 10.11.6 with Safari version 10.0.3
This works for me! 🆗
html:
scss: