css dimension

the css dimension properties is used to sets the width and height of an element.

there are following properties that allow you to control the dimensions of a box.

  • width -property is used to set the width of a box.
  • height -property is used to set the height of a box.
  • min-width -property is used to set the minimum width that a box can be.
  • max-width -property is used to set the maximum width that a box can be.
  • min-height - the css min-height property is used to set the minimum height that a box can be.
  • max-height -property is used to set the maximum height that a box can be.

width and height

the width and height properties is used to set the width and height for boxes.

         <html>
          
            <head>
            
         <style type="text/css"}
         
             p { width:400px;
             
                           height:420px;
                           
                           border:1px solid lime; }
                           
         </style>  </head>
         
         <body>
         
         <p>this is paragraph it width is 400px and height is 420px total width and height is 402px and 422px;</p>
         
    </body> </html>

all css dimension properties.

propertydescription
widthsets the width of an element.
min-widthsets the minimum width of an element.
max-widthsets the maximum width of an element.
heightsets the height of an element.
min-heightsets the minimum height of an element.
max-heightsets the miximum height of an element.