CSS Width & Height

Next ❯CSS Text

Used to define the Width & Height of element

  • turned_in_notProperties
    • labelWidth Properties
      • width
      • min-width
      • max-width
    • labelHeight Properties
      • height
      • min-height
      • max-height
    • labelHeight & Width values can be in
      • auto - the browser default (Default)
      • length - specifies in px, pt, cm, etc
      • % - specifies in percent(%)

Checkout the Width
h1 {
  width:100%;
  background-color:#5ccfcf;
}
widthsubject
widthclose
<!DOCTYPE html>
<html>
<head>
<title>Full CSS Code</title>
<style>
h1 {
  width:100%;
  background-color:#5ccfcf;
}
</style>
</head>
<body>
<h1 style="text-align: center;">Checkout the Width</h1>
</body>
</html>
  • label_outlineTryout Others
    PropertiesValues
    width:
    min-width:
    max-width:
    • min-width should be less than others
    • max-width limit the width value even it exceeds
Checkout the Height
h1 {
  hight:40px;
  background-color:#ac5ccf;
}
heightsubject
heightclose
<!DOCTYPE html>
<html>
<head>
<title>Full CSS Code</title>
<style>
h1 {
  hight:40px;
  background-color:#ac5ccf;
}
</style>
</head>
<body>
<h1 style="text-align: center;">Checkout the Height</h1>
</body>
</html>
  • label_outlineTryout Others
    PropertiesValues
    height:
    min-height:
    max-height:
    • min-height should be less than others
    • max-height limit the height value even it exceeds

  • CSS Text
❮ Prev CSS Padding
Next ❯CSS Text
TryOut Examples"Learn to Explore..!"

TryOut Editor

receipt