Good day! I can not stretch the div on the height of the content inside it. Here is html and css

HTML

body { text-align: left; font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 20px; color: #777777; height: 100%; background-color: #ededeb; } .mainbody{ width: 80%; height: 100%; margin: 0 auto; background-color: #fff; } .content{ margin: auto; display: block; width: 100%; height: 100%; max-width: 1480px; padding-left: 113px; } 
 <body> <div class="mainbody"><jdoc:include type="modules" name="mainbody" style="xmhtl" /> <div class="content"><jdoc:include type="modules" name="crimea" style="xmhtl" /></div> </div> </body> 

  • for this body specify height:100%; and only after that the height:100%; element height:100%; - user33274

1 answer 1

Add min-height and overflow :

 .content{ margin: auto; display: block; width: 100%; max-width: 1480px; padding-left: 113px; //***** min-height: 100px; overflow: auto; }