Preface: Use debugbar to view document code in ietester. There is this text: empty text node in every ul li, some are in span, in... In a word, there must be one under the li, sometimes there are more than one. Generally, there is no problem. Today, I encountered an unlucky thing. I saw that the text: empty text node had a height when using layout, and it was not the height of the li, but 4px higher than the displayed height of the li. For the previous paragraph, this 1px is painful, let alone 4px. This guy had me puzzled for a long time. Think about the translation: Text: Empty text node. If it is empty, why does it have a height? I searched online but found no corresponding explanation. I posted the CSS code, let's study it together. I added font-size:0px in the li; although it solved the problem, I still want to ask the experts to give some reasons! Copy code The code is as follows:.sidebar_menu{width:225px; list-style:none; position:relative;} .sidebar_menu li{ line-height:34px;width:225px; height:35px;<SPAN style="COLOR: #ff0000">font-size:0px;</SPAN> position:relative;} .sidebar_menu li span{ display:block;width:225px;height:34px; overflow:hidden; border-bottom:1px solid #007ac7;} .sidebar_menu li span a{ width:225px;text-align:left;text-indent:35px;display:block; font:14px/34px Arail,"Microsoft YaHei";color:#333; background:#c3e1f4;} Upload a screenshot This picture can be seen very well in ietester. Click layout to see the text: empty text node. ![]() |
<<: canvas.toDataURL image/png error handling method recommendation
>>: Detailed introduction to linux host name configuration
1. concat() function Function: Concatenate multip...
1. Download Download address: https://dev.mysql.c...
1. Resume nacos database Database name nacos_conf...
1. Experimental Environment serial number project...
Using the CSS float property correctly can become...
Let’s take a look first. HTML source code: XML/HT...
This article shares the specific code of native j...
WeChat applet uniapp realizes the left swipe to d...
1. IE browser mode Hack logo 1. CSS hack logo Copy...
When we add an svg image to display, react prompt...
This article mainly introduces the detailed proce...
Detailed explanation and examples of database acc...
VMware tools provides great convenience for using...
I made a Dockerfile for openresty on centos7 and ...
Table of contents User Management Create a new us...