Home >Web Front-end >HTML Tutorial >About li placeholder issue_html/css_WEB-ITnose
CSS
Now I have multiple divs with code similar to 71d9fbf3086565433ac40545af2f659f
<style type="text/css">.lsoftware-summary{float:left;padding:1px;width:960px;} .lsoftware-summary li{float:left;line-height:26px;white-space:nowrap;overflow:hidden;font-size:14px;text-align:center;margin-left:1px;background:#E1F0FF;display:block;} .lbianhao{width:120px;zoom:1;} .lmingcheng{width:510px;zoom:1;} .lbumen{width:160px;zoom:1;} .lriqi{width:90px;zoom:1;} .lzhuangtai{width:70px;zoom:1;} .ztfontcolorg{color:#F00;} .ztfontcolorx{color:#000;} .ztfontcolorj{color:#090;} .ztfontcolorz{color:#900;}</style><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script><script type="text/javascript"> $(function(){ if($("div ul li:eq(2)").text()==""){ $(this).hide(); } });</script><DIV class="lsoftware-summary ztfontcolorx" name="testD"> <UL class="clearfix"> <ul> <li class="lbianhao">206231991</li> </ul> <LI class="lmingcheng"> 的发生大法师打发</LI> <LI class="lbumen">集团公司</LI> <LI class="lriqi">2001-06-01</LI> <LI class="lzhuangtai">即将实施</LI> </UL> </DIV>What I mean is to force li to occupy space, not to hide it when there is no content in li. Is there any good way to do this?
Set the height or use an empty text placeholder
Thank you, I used whitespace symbols to achieve it, haha
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title></title><style>.lsoftware-summary{float:left;padding:1px;width:960px;}.lsoftware-summary li{float:left;line-height:26px;white-space:nowrap;overflow:hidden;font-size:14px;text-align:center;margin-left:1px;background:#E1F0FF;display:block;}.lbianhao{width:120px;zoom:1; float:left; display:inline; height:26px; line-height:26px;}.lmingcheng{width:510px;zoom:1;}.lbumen{width:160px;zoom:1;}.lriqi{width:90px;zoom:1;}.lzhuangtai{width:70px;zoom:1;}.ztfontcolorg{color:#F00;}.ztfontcolorx{color:#000;}.ztfontcolorj{color:#090;}.ztfontcolorz{color:#900;}</style></head><body><DIV class="lsoftware-summary ztfontcolorx" name="testD"><UL class="clearfix"> <ul> <li class="lbianhao"></li> </ul> <LI class="lmingcheng"> 的发生大法师打发</LI> <LI class="lbumen">集团公司</LI> <LI class="lriqi">2001-06-01</LI> <LI class="lzhuangtai">即将实施</LI></UL></DIV></body></html>