It is used to set the height and width of an element, it increases and decreases the height and width
<style> .class1{ height:100px; border:2px solid green; width:200px; } </style> </head> <body> <p>Height and width</p> <div class="class1">Techfunda is a online tutorial</div> </body>
In the above code snippet we have defined the height and width properties in the style sheet
output
It is used to provide the minimum height, min height provides the height of 100px
<style> .class1{ min-height:100px; border:1px solid green; width:200px; background-color:violet; } </style> </head> <body> <p>MinHeight</p> <div class="class1">Techfunda is a online tutorial</div> </body>
In the above code snippet we have defined the min height, min height provides the height as 100 px
output
It is used set the maximum height than the given height by giving the max width value
<style> .class1{ max-height:20px; border:1px solid green; width:200px; background-color:violet } </style> </head> <body> <p>MaxHeight</p> <div class="class1">Techfunda is a online tutorial</div> </body>
In the above code snippet we have defined the max height, It prevents the used value of the height property.
output
It provides the minimum width by giving the min width value
<style> .class1{ border:2px solid blue; min-width:100px; background-color:green; } </style> </head> <body> <p>MinWidth</p> <div class="class1">Techfunda is a online tutorial</div> </body>
In the above code snippet we have defined the min width with 100px
output
It provides the max width to the given element
<style> .class1{ border:2px solid blue; max-width:100px; background-color:pink; } </style> </head> <body> <p>Max Width</p> <div class="class1">Techfunda is a online tutorial</div> </body>
In the above code snippet we have defined the max width withe 100px, It prevents the used value of the width property.
output
We can provide the height and width to the image
<p>Image width and height</p> <img src="aaple.jpg" height="100" width="200"/>
In the above code snippet we have defined the image with height and width as 100 and 200
output
Views: 3830 | Post Order: 114