CSS Height, Width

Home / CSS / CSS Height, Width

CSS Height, Width


CSS-Height-Width:

The CSS height and width properties are used to set the height and width of an element.

Example :

 
<style>  
    .box1{
      height: 100px;
      width: 100px;
      background-color: blue;
    }
    .box2{
      height: 200px;
      width: 200px;
      background-color: rgb(0, 255, 255);
    }
    .box3{
      height: 300px;
      width: 300px;
      background-color: rgb(255, 68, 0);
    }
    .box4{
      height: 400px;
      width: 400px;
      background-color: rgb(0, 255, 0);
    }
    .box5{
      height: 500px;
      width: 500px;
      background-color: yellow;
    }
  </style>

Output: