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

Implementation of CSS child element selection parent element

Usually a CSS selector selects from top to bottom...

Vue custom optional time calendar component

This article example shares the specific code of ...

Detailed explanation of using scp command to copy files remotely in Linux

Preface scp is the abbreviation of secure copy. s...

How to implement the Vue mouse wheel scrolling switching routing effect

A root routing component (the root routing compon...

Vue simple implementation of turntable lottery

This article shares the specific code of Vue to s...

Implementation of CSS linear gradient concave rectangle transition effect

This article discusses the difficulties and ideas...

Working principle and implementation method of Vue instruction

Introduction to Vue The current era of big front-...

What are the attributes of the JSscript tag

What are the attributes of the JS script tag: cha...

Detailed explanation of how to create an updateable view in MySQL

This article uses an example to describe how to c...

Based on the special characters in the URL escape encoding

Table of contents Special characters in URLs URL ...

Use scripts to package and upload Docker images with one click

The author has been working on a micro-frontend p...

Vue implements adding watermark effect to the page

Recently, when I was working on a project, I was ...

How to use React slots

Table of contents need Core Idea Two ways to impl...

Implementation of debugging code through nginx reverse proxy

background Now the company's projects are dev...