Setting Maximum height

You can use the max-height property to set maximum height.

  • auto
  • <length>
  • <%>

auto is to let the browser do the calculation.

        <style type="text/css"> 
        p { 
            background: lightgray; 
            border: 4px solid black; 
            margin: 2px; 
            box-sizing: border-box; 
            min-width: 100px; 
            max-height: 200px; 
                    HyperText Markup Language (HTML) is the main markup language for 
                    displaying web pages and other information that can be displayed 
                    in a web browser(From From Wikipedia, the free encyclopedia).
Click to view the demo
  HTML CSS Book 

  1. Controlling the Size of an Element
  2. Setting Minimum height
  3. Setting Minimum width
  4. Setting Maximum width
  5. Setting Maximum height
  6. Setting the Sized Box