“Cara Auto Fit Image Di Div” Kode Jawaban

Cara Auto Fit Image Di Div

<img style='height: 100%; width: 100%; object-fit: contain'/>
Xerothermic Xenomorph

Cara Auto Fit Image Di Div

img {
    max-width: 100%;
    max-height: 100%;
}

.portrait {
    height: 80px;
    width: 30px;
}

.landscape {
    height: 30px;
    width: 80px;
}

.square {
    height: 75px;
    width: 75px;
}
Xerothermic Xenomorph

Cara Auto Fit Image Di Div

Portrait Div
<div class="portrait">
    <img src="http://i.stack.imgur.com/xkF9Q.jpg">
</div>

Landscape Div
<div class="landscape">
    <img src="http://i.stack.imgur.com/xkF9Q.jpg">
</div>

Square Div
<div class="square">
    <img src="http://i.stack.imgur.com/xkF9Q.jpg">
</div>
 Run code snippet
Xerothermic Xenomorph

Jawaban yang mirip dengan “Cara Auto Fit Image Di Div”

Pertanyaan yang mirip dengan “Cara Auto Fit Image Di Div”

Lebih banyak jawaban terkait untuk “Cara Auto Fit Image Di Div” di HTML

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya