• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

CSS Dimensions

Dimensions

Dimensions in CSS can control the height and width of an element. The height and width does not include padding, margins, and borders. It just sets the height and width inside the padding, border, and margin of an element. Dimensions includes the following-

The height Property:- It defines the height of the content area of an element.

										    
											div {
												height: 300px;
											}
											
										

The width Property:- It defines the width of the content area of an element.

										    
											div {
												width: 300px;
											}
											
										

The max-height Property:- It defines the maximum height of the content area of an element.

										    
											div {
												height: 100px;
												max-height: 300px;
											}
											
										

The min-height Property:- It defines the minimum height of the content area of an element.

										    
											div {
												height: 500px;
												min-height: 300px;
											}
											
										

The max-width Property:- It defines the maximum width of the content area of an element.

										    
											div {
												width: 100px;
												max-width: 300px;
											}
											
										

The min-width Property:- It defines the minimum width of the content area of an element.

										    
											div {
												width: 500px;
												min-width: 300px;
											}