Set max-height to 200px in HTML and CSS

Description

The following code shows how to set max-height to 200px.

Example


<html>
<head>
<style type='text/css'>
p {<!--  w w w  . j  a va  2  s. co  m-->
padding: 10px;
margin: 10px;
border:  1px solid black;
background: lightgray;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
max-height: 200px;
}
</style>
</head>
<body>
<p>
this is a test. this is a test. this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test.
this is a test. this is a test. this is a test. this is a test.
</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Set max-height to 200px in HTML and CSS