Height and Width Properties:

  • By using height and width, we can set the height and width of an element.
  • Value can be specified in pixels,% or cm.
  • To set maximum and minimum heights and widths, we have to use       
    1. max-width
    2. min-width
    3. max-height
    4. min-height
  • Syntax: property_name: value;
  • Ex: width: 40px;
     Code:
     
     Output:
    
  • Here i changed the height and width of input element by using css width and height properties.
  • We can set height and width to an image also.
  • Height and width property to div tag.
     Code:
     
    Output: