The height and width property allows you to specify the height and width an element.
It sets the height/width of the area inside the padding, border, and margin of the element..
All the height and width properties can have the following values:
length - specifies a height and width in px, pt, cm, etc.
% - specifies a height and width in % of the containing block.
auto - This is default and the browser calculates the height and width.
initial - Sets the height/width to its default value.
inherit - The height/width will be inherited from its parent value
Example : CSS - Height and Width
<!DOCTYPE html>
<html>
<head>
<style>
p{
height: 100px;
width: 500px;
background-color: blue;
}
</style>
</head>
<body>
<p>Code Always.<p>
</body>
</html>
When the above code is compiled , it produces the following result.
You can set CSS height/width properties inline, internal and external way of using CSS in your HTML page.