Pixels
Description
The mainstream browsers treat 1 pixel to be 1/96th of an inch.
Example
The following code shows demonstrates specifying pixels in a CSS style.
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
p {<!-- w w w.ja v a2s .co m-->
background: grey;
color:white;
font-size: 20px;
width: 200px;
}
</style>
</head>
<body>
<p>This is a test.</p>
</body>
</html>
Note
em
units are more flexible.
You only have to alter the size of the font and the rest of the style works seamlessly.