material icon indicating copy to clipboard operation
material copied to clipboard

md-content height in percent?

Open Superlukec opened this issue 11 years ago • 10 comments

Is there possible that you can specify height in percents and not only pixels for md-content?

For example:

This works: <md-content class="md-padding" style="height: 200px;">

This doesn't work: <md-content class="md-padding" style="height: 30%;">

Thank you for your help!

Superlukec avatar Dec 03 '14 10:12 Superlukec

@Superlukec – In the meantime you might be able to get away with 30vh if your percentage is viewport-relative.

Josh-Burgess avatar Dec 08 '14 22:12 Josh-Burgess

Might also be worth trying layout-fill on the md-content, and a wrapper div if necessary

plato-cambrian avatar Dec 11 '14 06:12 plato-cambrian

@Superlukec you have a CSS problem here. Make sure your content's parent has a height defined.

http://css-tricks.com/almanac/properties/h/height/

ajoslin avatar Dec 15 '14 18:12 ajoslin

I see the issue has been closed, however I am still having this problem for a column style layout; if I set the style for the md-content in px, it works fine, however if I set it in %, I never get a vertical scrollbar. Any thoughts?

servionsolutions avatar Feb 22 '15 20:02 servionsolutions

Same here

Schneider95 avatar Apr 05 '15 21:04 Schneider95

Same issue

csvan avatar Jun 02 '15 17:06 csvan

Wrap md-content with a div with the desired height, and then set md-content with "height: inherit;"

bonatoc avatar Jun 02 '15 19:06 bonatoc

same issue. parent wrapper div with an md-content gets no scrollbar.

div(style='height:100%;') md-content(flex='')

ghost avatar Aug 14 '15 18:08 ghost

Same here. <md-content md-scroll-y> takes height of the content and overflows viewport

karray avatar Aug 30 '15 11:08 karray

Here is a quick fix for the issue: http://codepen.io/topherfangio/pen/epOvBd?editors=110

Basically, you need to add the following so that the flex on the md-content renders properly:

.layout {
   height: inherit;
}

We are looking at adding this at a framework level but need to make sure that there are no unintended consequences.

topherfangio avatar Aug 30 '15 12:08 topherfangio