Scenario 1: Html: <div class="outer"> <div class="A">Header DIV </div> <div class="B">Lower DIV</div> </div> CSS: html, body { height: 100%; padding: 0; margin: 0; } .outer { height: 100%; padding: 100px 0 0; box-sizing: border-box ; position: relative; } .A { height: 100px; background: #BBE8F2; position: absolute; top: 0 ; left: 0 ; width: 100%; } .B { height: 100%; background: #D9C666; } Effect: Scenario 2: HTML: <div class="outer"> <div class="A">Header DIV</div> <div class="B">Lower DIV</div> </div> CSS: html, body { height: 100%; padding: 0; margin: 0; } .outer { height: 100%; padding: 100px 0 0; box-sizing: border-box ; } .A { height: 100px; margin: -100px 0 0; background: #BBE8F2; } .B { height: 100%; background: #D9C666; } Effect: This is the end of this article about div adaptive height to automatically fill the remaining height. For more relevant div adaptive height content, please search 123WORDPRESS.COM's previous articles or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! |
<<: Not all pop-ups are rogue. Tips on designing website pop-ups
>>: Deploy the Vue project on a Linux server
Error description When we install Docker Desktop,...
MySQL 8.0.22 installation and configuration metho...
Table of contents 1. Reference plugins in the uni...
Table of contents Pull a centos image Generate ng...
Development Background: Recently, I am working on...
In Linux operations, we often replace and count s...
This article shares the specific code of JavaScri...
If people have been idle for too long, they will ...
Foregoing: This document is based on the assumpti...
Table of contents 1. MySQL installation 1.2 Creat...
Since I returned the Mac, my original laptop has ...
Table of contents Overview (Loop Mode - Common) D...
1. The difference between Http and Https HTTP: It...
1. Display effect: 2, html structure <div clas...
Preface In the process of writing code, we will i...