Frage

I have a plunker to show: http://plnkr.co/edit/nGjdvrG27jNpQ3QTulMr?p=preview

I want the green area to fill the remaining available height. I can set div height:100% and get almost I want, but that is less than desirable.

Is there a way to do this with css? Do I need to do some sort of resizing via js?

War es hilfreich?

Lösung

I've set the following classes to height: 100% and it seems to work now:

.tabset, .tab-content, .tab-pane, .tabbable {
  height:100%;
}

Updated Plunker

Andere Tipps

if you use flexbox layout you can do it this way:

override the display property of the '.tab-content>.active' class. By default it is set to 'display: block'. It has to be set to 'display: flex'. Also modify the tab template.

See my solution:

Using flexbox layout with angular-ui tabs

The easiest way that I know is to set the height with vh units. They were introduced in CSS3

height: 100vh;

Updated plunker.

vh unit is setting the viewport height. I believe it's viewed as setting it to a % of the viewport, or visible screen. So simply changing 100% to 100vh gives you the desired outcome.

It seems like it's pretty widely used: http://caniuse.com/#search=vh. Just depends on who your audience base is I suppose.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top