CSS Dimensions


width

The "width" property is used to set the width of the element. The value is a numeric value or percentage consisting of a floating-point number and a unit identifier.

Example :

p {
   width: 100px;  
   height: 80%;
}

height

The "height" attribute is used to set the height of the element. The value is a numeric value or percentage consisting of a floating-point number and a unit identifier.

For the <img> tag, if only the height attribute is specified, and its width value will be scaled according to the size of the image source, and vice versa.


Maximum width

The "max-width" attribute is used to set the maximum width of an element, it must not exceed the set value.

Example :

p {
    max-width: 80%;  
    max-height: 200px;
}

Minimum width

"min-width" attribute is used to set the minimum width of the element.


Maximum height

The "max-height" attribute is used to set the maximum height of the element, the height of the element must not exceed this value.


Minimum width

"min-height" attribute is used to set the minimum height of the element.




Copyright 2014-2017 by DeveloperTut.com. All Rights Reserved.
TwitterGoogle+Facebook