min and max

Supported fully by Mozilla and Opera.

Safari only supports max- and min-width, not height.

min-height is supported by Explorer 6 only for table elements inside a table with table-layout: fixed.

min-height on body or html works only in Opera. Test page.

With min-width and min-height you can set a minimum width and height for HTML elements, while max-width and max-height set a maximum width and height. These properties overrule the normal width and height.

The value none removes a max-height or max-width, though not a min-height or min-width.

All paragraphs below have these styles:

.test {
	background: #CE6BBD;
	color: #ffffff;
	width: 400px;
	height: 100px;
	padding: 10px;

This is the default test paragraph. All paragraphs below have an extra min/max declaration added.

Test paragraph with max-width: 100px

Test paragraph with min-width: 500px

Test paragraph with max-height: 30px, even though I put a lot of content in just to try to stretch it a tiny little bit (which, of course, doesn't work thanks to the Power of Standards).

Test paragraph with min-height: 200px

This one is for Explorer 6, where only min-height works only on table elements in a fixed table. Of course it doesn't work in any other browser.

TD without min-height
TD with min-height: 500px