Answers for "how to stop image from resizing css"

1

scale down image css

img.resize {
    width: 540px; /* you can use % */
    height: auto;
}
Posted by: Guest on January-29-2021
0

force image no resize css

<!-- See here for demo: https://codepen.io/blairwadman/pen/GJZpmM -->
<div class="container">
  <div class="image">
    <img src="http://placehold.it/100x100" width="100" height="100" >
  </div>
  <div class="info">
    <p>Temporibus luctus inventore! Ornare adipisicing occaecati sunt leo optio porta rhoncus venenatis illum, consequat vulputate, ab. Tenetur velit porta pariatur.</p>
  </div>
</div>
<style>
  .container {
    display: flex;
} 
  img {
  width: 100%;
}

.image {
    flex-shrink: 0;
}
</style>
Posted by: Guest on August-20-2021

Browse Popular Code Answers by Language