Answers for "aligner image verticalement css"

CSS
1

css center image in div

<div style="width: 300px; height: 300px;">
  <img src="./image.png" class="center">
</div>

.center{
  object-fit: scale-down;
  max-width: 100%;
  max-height: 100%;
  height: 15em; /*set your constraint to height/width and set the other to auto*/
  width: auto; 
}
Posted by: Guest on November-16-2020

Browse Popular Code Answers by Language