Li line spacing is large (more than 5 pixels in IE) solution

Source: Internet
Author: User
Tags definition

The code is as follows:


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


The above definition of Li's line spacing should be 23px, but IE is indeed 28px, more than 5 pixels, the reason is not known, the solution is as follows (red indicates test OK):
1. To solve the Li in the IE5 to create blank spacing method: If Li defined the width, then need to define the Vertical-align:bottom in Li;
2. Width is best not defined in the UL, defined in the LI or UL outer div inside.
3. The best way to write Li, Li to write height and width, as well as Vertical-align:bottom (for Ie5/win bug), or outside the UL add a layer of div, and define width, Then there is no definition of width and vertical-align:bottom in Li, and normal (IE5 does not produce blank spacing), but the height is defined.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.