Saturday, August 18, 2012

CSS Dimension


The CSS dimension properties allow you to control the height and width of an element.

Try it Yourself - Examples

Set the height of elements
This example demonstrates how to set the height of different elements.

Set the height of an image using percent
This example demonstrates how to set the height of an element using a percent value.

Set the width of an element using a pixel value
This example demonstrates how to set the width of an element using a pixel value.

Set the maximum height of an element
This example demonstrates how to set the maximum height of an element.

Set the maximum width of an element using percent
This example demonstrates how to set the maximum width of an element using a percent value.

Set the minimum height of an element
This example demonstrates how to set the minimum height of an element.

Set the minimum width of an element using a pixel value
This example demonstrates how to set the minimum width of an element using a pixel value.


All CSS Dimension Properties

The number in the "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2).

PropertyDescriptionValuesCSS
heightSets the height of an elementauto
length
%
inherit
1
max-heightSets the maximum height of an elementnone
length
%
inherit
2
max-widthSets the maximum width of an elementnone
length
%
inherit
2
min-heightSets the minimum height of an elementlength
%
inherit
2
min-widthSets the minimum width of an elementlength
%
inherit
2
widthSets the width of an elementauto
length
%
inherit
1


No comments:

Post a Comment