The IE environment stipulates that the div height must be greater than the font height

The IE environment stipulates that the div height must be greater than the font height

Copy code
The code is as follows:

<div class="content">
<div class="title"></div>
<div class="body">
...
</div>
<div class="bottom"></div>
</div>

After searching, I found out that IE stipulates that the height of the div box must be higher than the font height of the box. The default height set on the web page is 12px. Therefore, setting the div height to 10px will inevitably fail.

The solution is very simple, just set the font size of the div to 0, so that the height set by the div will work normally and the web page will return to normal.

PS: A new solution has been found for this problem, which is to add a sentence at the top of the page code to indicate support for W3C standards. For details, please refer to my other article: Notes on Writing Web Front-end Code

<<:  Example code for implementing the nine-grid layout of dynamic images with CSS

>>:  HTML+CSS+JavaScript to achieve list loop scrolling example code

Recommend

How to import Excel files into MySQL database

This article shares with you how to import Excel ...

Linux kernel device driver kernel linked list usage notes

/******************** * Application of linked lis...

CSS Transition expands and collapses elements by changing the Height

A common development need is that we want to coll...

13 JavaScript one-liners that will make you look like an expert

Table of contents 1. Get a random Boolean value (...

Two ways to remove the 30-second ad code from Youku video

I believe everyone has had this feeling: watching ...

Nginx implements dynamic and static separation example explanation

In order to speed up the parsing of the website, ...

Docker exec executes multiple commands

The docker exec command can execute commands in a...

This article takes you to explore NULL in MySQL

Table of contents Preface NULL in MySQL 2 NULL oc...

CSS float (float, clear) popular explanation and experience sharing

I came into contact with CSS a long time ago, but...

6 solutions to IDEA's inability to connect to the MySQL database

This article mainly introduces 6 solutions to the...

Solution to the conflict between Linux kernel and SVN versions

Phenomenon The system could compile the Linux sys...

Usage of Linux userdel command

1. Command Introduction The userdel (user delete)...

Mysql 5.6 "implicit conversion" causes index failure and inaccurate data

background When performing a SQL query, I tried t...

JS implements Baidu search box

This article example shares the specific code of ...