html - How can i make an Image as large as possible in a Mdl-Card-Lightbox? -
i creating lightbox material design lite card design without javascript. each image should displayed large possible in lightbox-card. have every kind of pictures, landscape, portrait, banners, ... card should adapt size of image. however, nothing should cut off picture!
here's html code:
<a href="#" class="lightbox" id="img1"> div class="demo-card-image mdl-card mdl-shadow--2dp"> <div class="mdl-card__title mdl-card--expand"></div> <div class="mdl-card__actions"> <span class="demo-card-image__filename">example title</span> </div> </div> </a>
the card should not larger 90% in width , 80% in height.
scss code:
.demo-card-image.mdl-card { max-width: 90%; max-height: 80%; top: 50%; left: 50%; transform: translate(-50%, -50%); background: url('http://placehold.it/500x300')no-repeat center center; } .demo-card-image > .mdl-card__actions { height: 52px; padding: 16px; background: rgba(0, 0, 0, 0.2); }
Comments
Post a Comment