max-width, min-width,max-height
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/xhtml; charset=windows-1252" />
<meta http-equiv="content-language" content="en-us" />
<style type="text/css">
div#body {
margin: auto;
max-width: 50em;
min-width: 30em;
max-height: 30em;
overflow: auto;
background: #ccc;
}
</style>
</head>
<body>
<div id='body'>
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test. <BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test. <BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
<BR/>This is a test.
</div>
</body>
</html>
Related examples in the same category