Set height to 1in(Inch) in HTML and CSS

Description

The following code shows how to set height to 1in(Inch).

Example


<html>
<head>
<style type='text/css'>
div {<!--from   w ww  .j a v  a  2s .c o m-->
background: #000;
border: 1px solid rgb(128, 128, 128);
color: white;
font: 9px monospace;
margin: 15px;
text-align: center;
}
div#inches {
width: 1in;
height: 1in;
}
div#pixels {
width: 96px;
height: 96px;
}
</style>
</head>
<body>
<div id='inches'>&lt;-- 1 Inch --&gt;</div>
<div id='pixels'>&lt;-- 96 Pixels --&gt;</div>
</body>
</html>

Click to view the demo

The code above generates the following result.

Set height to 1in(Inch) in HTML and CSS