UL LI不能居中,请高手赐教
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0038)http://localhost:4524/TextMonitor.aspx -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>无标题页</TITLE>
<STYLE type=text/css>.STYLE2 {
COLOR: #ffffff
}
BODY {
BACKGROUND-COLOR: #9ac5db
}
.c1 {
COLOR: #663399; FONT-SIZE: 14px
}
.c2 {
MARGIN-TOP: 5px; FONT-SIZE: 12px
}
UL {
TEXT-ALIGN: center; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px; PADDING-LEFT: 0px; WIDTH: 100%; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
LI {
TEXT-ALIGN: center; MARGIN: 5px; WIDTH: 13%; BACKGROUND: #333366; FLOAT: left; COLOR: #ffffff
}
</STYLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7601.17744"></HEAD>
<BODY>
<FORM id=form1 method=post name=form1 action=TextMonitor.aspx>
<DIV><INPUT id=__VIEWSTATE
value=/wEPDwUJMzE4MTEyMzk4ZGR780OmRKbhsSWm41jFhg+gCRDz3g== type=hidden
name=__VIEWSTATE> </DIV>
<DIV>
<TABLE width="100%">
<TBODY>
<TR>
<TD height=52 background=v_files/f15_09.gif align=middle>
<P><SPAN
class=STYLE2><STRONG>XX区坏境</STRONG><STRONG>VOC</STRONG><STRONG>污染源在线监控平台(企业同步比)</STRONG></SPAN>
</P></TD></TR></TBODY></TABLE>
<TABLE width="100%">
<TBODY>
<TR>
<TD bgColor=#cbdeea>
<UL>
<LI>
<DIV class=c2>72.08%</DIV>
<DIV class=c2>AAAAA</DIV></LI>
<LI>
<DIV class=c2>5.07%</DIV>
<DIV class=c2>BBBBB</DIV></LI>
<LI>
<DIV class=c2>0%</DIV>
<DIV class=c2>CCCCC</DIV></LI>
<LI>
<DIV class=c2>3.12%</DIV>
<DIV class=c2>DDDDD</DIV></LI>
<LI>
<DIV class=c2>35.35%</DIV>
<DIV class=c2>EEEEE</DIV></LI>
<LI>
<DIV class=c2>0.97%</DIV>
<DIV class=c2>FFFFF</DIV></LI>
<LI>
<DIV class=c2>0.21%</DIV>
<DIV
class=c2>系统测试</DIV></LI></UL></TD></TR></TBODY></TABLE></DIV></FORM></BODY></HTML>
这是全部代码,问题就是UL LI不能居中,请问如何改正才能居中,小弟先谢谢各位了
------解决方案--------------------
UL {
TEXT-ALIGN: center; PADDING-BOTTOM: 0px; LIST-STYLE-TYPE: none; MARGIN: 0px auto; PADDING-LEFT: 0px; WIDTH: 700px; PADDING-RIGHT: 0px; PADDING-TOP: 0px
}
LI {
TEXT-ALIGN: center; MARGIN: 5px; WIDTH: 90px; BACKGROUND: #333366; FLOAT: left; COLOR: #ffffff
}
------解决方案--------------------margin: 5px
再加上每个13%
能到100%吗
你的计算有问题
最后还是固定值好算些
都是百分比的话,你自己算吧。