css - Bootstrap center an image inside the div but without resizing -
i need place image inside div. know there img-responsive center-block classes resize given image reason. there way achieve same goal without size distortions.
note: containing div bootstrap column given classes: hidden-xs col-lg-9 col-md-6 col-sm-6.
thank you
css friend
can try css class
html
<img class="centerd-image" src=""> or <div class="centerd-image"> <img src=""> </div>
css
.centerd-image { margin: 0; position: absolute; top: 50%; left: 50%; margin-right: -50%; -moz-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); -o-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); }
Comments
Post a Comment