css - Twitter Bootstrap 3 modal: image not resizing vertically -
i'm working twitter bootstrap 3 , i'm using modal dialog display 2 divs side side. left div contains centered image should adjust container dimensions, keeping aspect ratio. issue following: if resize browser window vertically image height doesn't decrease bellow value , gets outside dialog boundaries, resulting in
this code i've reached far:
<!-- modal --> <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true" > <div class="modal-dialog" style="width: 90%; height: 100%;"> <div class="modal-content" style="width: 100%; height: 100%; background-color: red;"> <div class="modal-body" style="width: 100%; height: 100%;"> <div class="text-center " style="float: left; width: 60%; background-color: #f1f1f1; height: 100%; display: table;"> <div style="display: table-cell; vertical-align: middle; "> <img class=""src="img/project_image.png" width="100%" style="" /> </div> </div> <div style="float: right; width: 40%; background-color: blue;"> <p>big rabbit illustration</p> </div> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
i think see problem. image doesnt have height, has width.
<img class=""src="img/project_image.png" width="100%" style="" />
but real problem starts here. if put height @ 100% image might distorted. might want write jquery image. like, when window height big, image use height="100%"
, when window width big use width="100%"
Comments
Post a Comment