How to make a div height adaptive to the browser height

How to make a div height adaptive to the browser height
This old question has troubled countless front-end developers and back-end programmers. It is actually very simple. I wrote it here to share with you. Many people say that I have set the div to 100%, but it still has no effect. What I want to say is that there is a key thing that you did not set.

Copy code
The code is as follows:

html,body{height:100%;overflow:hidden;}

Haha, now you get it, you need to set them at the same time.

<<:  CSS3+Bezier curve to achieve scalable input search box effect

>>:  vue-admin-template dynamic routing implementation example

Recommend

Analysis of product status in interactive design that cannot be ignored in design

In the process of product design, designers always...

List rendering instructions for efficient development of Vue front-end

v-for directive Speaking of lists, we have to men...

How to change the MySQL database directory location under Linux (CentOS) system

How to change the MySQL database directory locati...

Vue implements upload component

Table of contents 1. Introduction 2. Ideas Two wa...

Bug of Chinese input garbled characters in flex program Firefox

Chinese characters cannot be input in lower versio...

Detailed explanation of Vue px to rem configuration

Table of contents Method 1 1. Configuration and i...

MySQL subqueries and grouped queries

Table of contents Overview Subqueries Subquery Cl...

Summary of Linux date command knowledge points

Usage: date [options]... [+format] or: date [-u|-...

Solution to css3 transform transition jitter problem

transform: scale(); Scaling will cause jitter in ...

5 common scenarios and examples of JavaScript destructuring assignment

Table of contents Preface 1. Extract data 2. Alia...

MySQL free installation version configuration tutorial

This article shares the MySQL free installation c...

Three ways to implement text color gradient in CSS

In the process of web front-end development, UI d...