Solution to large line spacing (5 pixels more in IE)

Solution to large line spacing (5 pixels more in IE)

Copy code
The code is as follows:

li {width:300px; height:23px; line-height:24px:}
<ul>
<li>Large line spacing</li>
<li>Large line spacing</li>
<li>Large line spacing</li>
<ul>

After the above definition, the line spacing of li should be 23px, but IE is 28px, 5 pixels more. The reason is unknown. The solution is as follows (red means the test is OK):
1. The solution to the problem of blank line spacing in li under IE5: If the width of li is defined, then vertical-align: bottom; needs to be defined in li.
2. It is best not to define the width in UL, but in the DIV outside LI or UL.
3. The best way to write LI is to write the height and width, as well as vertical-align: bottom; in li (for ie5/win bug), or add a div outside ul and define the width. Then you don’t need to define the width and vertical-align: bottom; in li, and it will display normally (no blank line spacing will be generated under IE5), but the height still needs to be defined.

<<:  Differences between FLOW CHART and UI FLOW

>>:  Solution to the problem that Xshell cannot connect to the virtualBox virtual machine

Recommend

JavaScript event capture bubbling and capture details

Table of contents 1. Event Flow 1. Concept 2. DOM...

Mysql string interception and obtaining data in the specified string

Preface: I encountered a requirement to extract s...

MySQL 5.7.17 installation and configuration graphic tutorial

Features of MySQL: MySQL is a relational database...

Use ab tool to perform API stress test on the server

Table of contents 1 A brief introduction to syste...

Two usages of iFrame tags in HTML

I have been working on a project recently - Budou...

jQuery to achieve sliding stairs effect

This article shares the specific code of jQuery t...

CSS positioning layout (position, positioning layout skills)

1. What is positioning? The position attribute in...

This article will show you the basics of JavaScript: deep copy and shallow copy

Table of contents Shallow copy Deep Copy Replenis...

Linux firewall iptables detailed introduction, configuration method and case

1.1 Introduction to iptables firewall Netfilter/I...

Example of how to import nginx logs into elasticsearch

The nginx logs are collected by filebeat and pass...

VUE Getting Started Learning Event Handling

Table of contents 1. Function Binding 2. With par...

mysql installer community 8.0.12.0 installation graphic tutorial

This tutorial shares the installation of mysql in...