welcome to tutorialfamily

css height width

this property used for apply height and width to element or content.


css height width

  • height: height of an element
  • max-height: max-height of an element
  • min-height: min-height of an element
  • width: width of an element
  • max-height: max-width of an element
  • min-height: min-width of an element

css height/width


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
div{ 
   height: 400px;
   width: 400px;
   border: 1px solid #000;
   color: #000;
   font-size: 20px;
   text-align: center;
   background-color: #f1f1f1;
}
</style>
</head>
<body>
   <div>my car</div>
</body>
</html>


Run

css max height/width


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
div{ 
   height: 400px;
   max-height: 300px;
   width: 400px;
   max-width: 300px;
   border: 1px solid #000;
   color: #000;
   font-size: 20px;
   text-align: center;
   background-color: #f1f1f1;
}
</style>
</head>
<body>
   <div>my car</div>
</body>
</html>


Run

css min height/width


						        
<!DOCTYPE html>
<html>
<head>
   <title>css tutorial</title>
<style>
div{ 
   height: 400px;
   width: 400px;
   min-height: 600px;
   min-width: 600px;
   border: 1px solid #000;
   color: #000;
   font-size: 20px;
   text-align: center;
   background-color: #f1f1f1;
}
</style>
</head>
<body>
   <div>my car</div>
</body>
</html>


Run

Our Content