How to set element size width, height, max min height width
You can set HTML element size using width or height property.
Also you can set element maximum height width or minimum height width.
CSS element size properties
following all properties are supported, all defined type value. using this properties you can set element size.
Properties | Value | Description |
---|---|---|
width height max-width min-width max-height min-height |
height: auto; height: 75%; height: 50px; height: inherit; height: 0; |
auto set percentage value pixel value parent value inherit unit less 0 value |
Set element maximum and minimum size
Following example are describe how to set element size as well as also define element maximum and minimum size. let check,
In this example <textarea> element height and width both are set also set maximum or minimum height width value.
Example
<!DOCTYPE html>
<html>
<head>
<title>CSS height, width property</title>
</head>
<body>
<textarea style="height: 70px; max-height: 150px; min-height: 60px; width: 400px; max-width: 550px; min-width: 250px;">This is a text area element.</textarea>
</body>
</html>