Set the maximum width that a box can be with CSS

CSSWeb DevelopmentFront End Technology

The max-width property is used to set the maximum width that a box can be. The value of the max-width property can be a number, a length, or a percentage.

Example

<html>
   <head>
   </head>
   <body>
      <p style = "max-width:100px; height:200px; border:1px solid green; padding:5px; margin:10px;">
         This paragraph is 200px high and max width is 100px
         This paragraph is 200px high and max width is 100px
      </p>
      <img alt = "logo" src = "/css/images/logo.png" width = "100" height = "100" />
   </body>
</html>
raja
Published on 18-Apr-2018 06:24:35
Advertisements