, , , , .
You can see how it lives: http://bekreatief.imtqy.com/demo/flexbox_img_with_captions/
<div class="screen">
<div class="img landscape"><img src="http://fc07.deviantart.net/fs71/f/2014/174/1/7/17a514b56717abed29512fddb462de82-d7nmo0f.png" alt="img_wide" /><span class="caption">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quas quibusdam voluptas vel facilis sunt quod consectetur assumenda praesentium perferendis nesciunt.</span></div>
</div>
<div class="screen">
<div class="img portrait"><img src="http://th01.deviantart.net/fs70/PRE/i/2012/016/0/d/ruffles_version_ii_by_mynimi94-d4mj9fv.png" alt="img_high" /><span class="caption">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea amet minus architecto quidem ab quisquam id, corrupti suscipit placeat natus neque cum ex enim eveniet quasi facere, eum asperiores distinctio.</span></div>
</div>
Check out the full code here: https://github.com/bekreatief/bekreatief.imtqy.com/tree/master/demo/flexbox_img_with_captions
// Sass
.screen{
width: 100%;
position: absolute;
left: 0;
height: 100vh;
box-sizing: border-box;
@include flexbox(row, wrap, center, center);
&:nth-of-type(1){
top: 0;
}
&:nth-of-type(2){
top: 100vh;
}
&:nth-of-type(3){
top: 200vh;
}
.img{
max-width: 100%;
height: 100vh;
@include flexbox(column, nowrap, center, center);
span{
text-align: left;
}
}
.landscape{
img{
max-height: 100vh;
max-width: 100%;
}
}
.portrait{
img{
height: 100vh;
}
}
}
source
share