css keep image ratio
img {
object-fit: cover;
width: 100px;
height:100px;
}
css keep image ratio
img {
object-fit: cover;
width: 100px;
height:100px;
}
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>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us