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
Usage of time difference functions TIMESTAMPDIFF ...
question When we are developing normally, if we w...
There are many tags in XHTML, but only a few are ...
Table of contents 1. Environmental Preparation 1....
A registration page template implemented with HTM...
Table of contents 1 redis configuration file 2 Do...
Resume Code: XML/HTML CodeCopy content to clipboa...
Effect: <div class="imgs"> <!-...
Preface In the MySQL database, sometimes we use j...
1. Overview of modules and instructions used to l...
Table of contents Deploy nginx on server1 Deploy ...
Often when we open foreign websites, garbled char...
Table of contents Preface Install vue-i18n Config...
Website administrators often accidentally delete ...
<!DOCTYPE HEML PUBLIC> <html> <hea...