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

A more elegant error handling method in JavaScript async await

Table of contents background Why error handling? ...

Detailed explanation of json file writing format

Table of contents What is JSON Why this technolog...

MySQL replication mechanism principle explanation

Background Replication is a complete copy of data...

Using js to achieve the effect of carousel

Today, let's talk about how to use js to achi...

Ubuntu 16.04 installation tutorial under VMware 12

This article shares with you the installation tut...

Detailed explanation of server-id example in MySQL master-slave synchronization

Preface When we build a MySQL cluster, we natural...

Vue custom component implements two-way binding

Scenario: The interaction methods between parent ...

How to install Django in a virtual environment under Ubuntu

Perform the following operations in the Ubuntu co...

JavaScript to implement drop-down list selection box

This article example shares the specific code of ...

Why is it slow when using limit and offset paging scenarios?

Let’s start with a question Five years ago when I...

Vue realizes the product magnifying glass effect

This article example shares the specific code of ...

HTML+CSS to achieve text folding special effects example

This article mainly introduces the example of rea...

Detailed explanation of how to select all child elements using CSS

How to recursively select all child elements usin...

Two ways to open and close the mysql service

Method 1: Use cmd command First, open our DOS win...