Build a simple HTML to check a file, will check Ul Li tag below
| It is quotative content below: <ul> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> </ul> <ul> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> Course of <li><a Href= "#" > is single </a></li> </ul> |
Test one, definition Css is following code, the effect is as follows
| It is quotative content below: View Plaincopy To Clipboardprint? Body{font-size:12px;margin:0} Ul{list-style:nOne;margin:0;padding:0;width:120px;} Ul Li{background:gReen;height:20px;} Ul Li A{color:#Fff;padding:00 0 10px;} Body{font-size:12px;margin:0}Ul{list-style:nOne;margin:0;padding:0;width:120px;}Ul Li{background:gReen;height:20px;}Ul Li A{color:#Fff;padding:00 0 10px;} |
Discovery produced blank in the left below IE5 and IE5.5, and be below IE5, the row spacing between LI produces blank, pursue as follows
Test 2, definition Css is following code
| It is quotative content below: View Plaincopy To Clipboardprint? Body{font-size:12px;margin:0} Ul{list-style:nOne;margin:0;padding:0;} Ul Li{background:gReen;height:20px;width:120px;} Ul Li A{color:#Fff;padding:00 0 10px;} Body{font-size:12px;margin:0}Ul{list-style:nOne;margin:0;padding:0;}Ul Li{background:gReen;height:20px;width:120px;}Ul Li A{color:#Fff;padding:00 0 10px;} |
With the test one photograph is compared, just Width:120px; lays the definition of Li from the definition of Ul, solved IE5 and IE5.5 left to produce blank problem, and the span between the Li of IE5 still has. Pursue as follows
Test 3, definition Css is following code
| It is quotative content below: Body{font-size:12px;margin:0}Ul{list-style:nOne;margin:0;padding:0;}Ul Li{background:gReen;height:20px;width:120px;vertical-align: Bottom;}Ul Li A{color:#Fff;padding:00 0 10px;} |
With the test 2 quite, vertical-align adds in the definition of Li: It is normal that Bottom;ie5 falls, the blank row spacing between Li disappeared, the result that obtains each browsers is same, pursue as follows
Summary
1, the method that solves Li to produce blank row spacing below IE5: If Li defined width, need to define Vertical-align again inside Li so: Bottom;
2, width had better not be defined in UL, the definition is in LI or inside the DIV with outer UL
3, the optimal kind that writes LI, height and width should be written inside Li, and Vertical-align: Bottom; (For Ie5/win Bug) , perhaps add a Div outside Ul, define width, need not define width and Vertical-align inside Li so: Bottom; , it is normal to also show () of blank row spacing won’t arise below IE5, do not cross height or should be defined.



