Prelims - Height, Width and Max-width Flashcards
property is used to set the maximum width of an element.
max-width
div { max-width: 500px; height: 100px; background-color: powderblue; }
properties are used to set the height and width of an element.
height
and width
The height and width properties do not include padding, borders, or margins. It sets the height/width of the area inside the padding, border, and margin of the element.
The height and width properties may have the following values:
auto - This is default. The browser calculates the height and width
length - Defines the height/width in px, cm, etc.
% - Defines the height/width in percent of the containing block
initial - Sets the height/width to its default value
inherit - The height/width will be inherited from its parent value
Sets the minimum width of an element
min-width