Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to auto fit image in div

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

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

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

.square {
    height: 75px;
    width: 75px;
}
Comment

how to auto fit image in 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
Comment

PREVIOUS NEXT
Code Example
Html :: s9 berlin 
Html :: HTMLPageStructure 
Html :: html text next line 
Html :: How to install Ubuntu 17.04 in VMWare Workstation 
Html :: close copy with html 
Html :: skiing in winter 
Html :: website design codes 
Html :: frameset col html 
Html :: html marquee space between images 
Html :: src not found in htmlelement 
Html :: the <video tag with more control 
Html :: html js import 
Html :: get all values in hidden field with the same name 
Html :: remove autocomplete 
Html :: html language 
Html :: jinja2 html attributes 
Html :: Aria hr role 
Html :: brackeys C# 
Html :: hirudhi map 
Html :: show image inside table with innerhtml 
Html :: How do I move my header to the right side in HTML? 
Html :: kodingan mencatumkan keterangan gambar header html 
Html :: background instagram image in html 
Html :: Accesing element using tag 
Html :: gafpa html cellule 
Html :: how to inherit template expath odoo 
Html :: data component attribute 
Html :: bold markup 
Html :: bootsrap loader 
Html :: how to add hindi in html 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =