We have a layout where we'd like a slider image to fill the height of it's parent.
We've achieved a static image example (no slider) by inserting an image into an inline background style, then used flexbox to ensure the div fills the height of it's parent (we couldn't get height:100%; to work - even when applied it to parent divs up the dom to body or html as suggested by others) - see here: http://jsfiddle.net/cmscss/WLggG/29/
/* HERO STYLES */
/* make hero children expand to fit height of parent becauase height:100%; doesn't work (even applying to all parents all the way up the dom to body or html) */
.hero {
display: -moz-box;
display: -webkit-flexbox;
display: -ms-flexbox;
display: -webkit-flex;
display: -moz-flex;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
background-color: #eeeeee;
border-top: 1px solid gray;
border-bottom: 1px solid gray;
}
.hero-image,
.hero-text {
width: 50%;
}
/* HERO IMAGE STYLES */
/* make inline hero image stretch to fill background */
.hero-image {
background-position: center center;
background-repeat: no-repeat;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
/* make slide img tag transparent so we can use background-size above */
.hero-image img {
margin: 0;
line-height: 0;
/* IE 8 */
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
/* IE 5-7 */
filter: alpha(opacity=0);
/* modern browsers */
opacity: 0;
}
But we're having trouble understanding how to get the extra divs required for a slider to inherit flexbox's full height behaviour.
See: http://jsfiddle.net/cmscss/WLggG/27/
Does anyone know how to apply flexbox's layout behaviour to grandchildren so it works like the first JSFiddle?
Any pointers in the right direction would be much appreciated.