How to solve the problem of large line spacing in li
This article mainly introduces "how to solve the problem of large line spacing in li". In daily operation, I believe many people have doubts about how to solve the problem of large line spacing in li. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "how to solve the problem of large line spacing in li". Next, please follow the editor to study!
The code is as follows:
Li {width:300px; height:23px; line-height:24px:}
The line spacing is very large
The line spacing is very large
The line spacing is very large
After the above definition, the line spacing of li should be 23px, but IE is indeed 28px with an extra 5 pixels. The solution is as follows (red indicates test OK):
1. The solution to the blank line spacing generated by li under IE5: if the li defines the width, then you need to define vertical-align: bottom; in the li.
two。 It is best not to define the width in UL, but in the outer DIV of LI or UL.
3. The best way to write LI, li inside to write height and width, and vertical-align: bottom; (for ie5/win bug), or add a layer of div outside the ul, and define the width, then in the li do not need to define the width and vertical-align: bottom;, also display normal (there is no blank line spacing under IE5), but the height still needs to be defined.
At this point, the study on "how to solve the problem of large line spacing in li" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!