Q:

max-height div and in div and paragraph in div

.wrap
{
  
  width:400px;
  height:200px;
  border:1px solid #000;
  }

.content
{
  width:300px;
  max-height:200px;
  background-color:blue;
  margin-left:50px;
  }
.content p
{
  margin:0;
  }
.header
{
  margin-left:20px;
  font-weight:bold;
    height:20px;
   }
.header p
{
  margin:0;
  
  }
<div class="wrap">
  <div class="header">
    <p>What is Lorem Ipsum?</p>
  </div>
  <div class="content">
   
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
    
    
  </div>
  
  
 </div>

Hello,
I have question about CSS only I think, maybe JS will be necessary. I would like that paragraph  was always in div (blue), and blue div will never exceed beyond div class="wrap". When if add more text in header blue div decrease height. 

A:

make max-height:180px; and add overflow: hidden for .content

.wrap
{
  
  width:400px;
  height:200px;
  border:1px solid #000;
  }

.content
{
  width:300px;
  max-height:180px;
  background-color:blue;
  margin-left:50px;
  overflow: hidden;
  }
.content p
{
  margin:0;
  }
.header
{
  margin: 0 0 0 20px;
  font-weight:bold;
    height:20px;
   }
.header p
{
  margin:0;
  
  }
<div class="wrap">
  <div class="header">
    <p>What is Lorem Ipsum?</p>
  </div>
  <div class="content">
   
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
    
    
  </div>
  
  
 </div>

