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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -