我有一个使用HTML的项目符号列表,如果句子转到两行,我希望这些单词排成一行。如果文本转到第二行,则它与子弹对齐。我希望它与文本对齐。
这就是我的意思:
这是我正在使用的代码:
答案 0 :(得分:0)
代码的结尾有点不对劲。您应该在<\li>
之前关闭<\ul>
,而不是相反。试试这个:
<TABLE style="BORDER-COLLAPSE: collapse; MARGIN-RIGHT: 8px">
<TBODY>
<TR>
<TD>
<UL>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Event will be held from 10am - 5pm Bring Your Dog With</SPAN></SPAN> </DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">$8 Entrance Fee (print out your flyer that you received and bring it with you to support your favorite Rescue (kids under 12 are FREE) $5 of you entrance fee will go to that dog rescue or organization</SPAN></SPAN> </DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">MUST bring Current Vaccination Paperwork, NO EXCEPTIONS, dogs will not be allowed in without this paperwork</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">No firearms, alcoholic beverages, outside food or drink, coolers or glass containers</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Bags will be checked prior to entrance</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Event will be photographed & videotaped</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">All dogs MUST have rabies tags attached to collars</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Collars MUST be worn at all times, NO METAL COLLARS of any kind allowed</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Owners/Handlers are legally responsible for the behavior/actions of their dogs</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Only 1 dog allowed per adult handler</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Dogs must be healthy, fully immunized, de-wormed, & wearing ID tags</SPAN></SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Female dogs in heat are NOT permitted</SPAN> </SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Dogs MUST be leashed at all times unless in dog play area, owners must watch their dog in this area at all times</SPAN></SPAN> </DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Owners MUST IMMEDIATELY clean up after their dogs, with a paper or plastic bag</SPAN> </SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">AGGRESSIVE dogs will be asked to leave</SPAN> </SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">MUZZLED dogs NOT allowed</SPAN> </SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Owners MUST keep their dogs under control at all times</SPAN> </SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Children MUST be closely supervised</SPAN></SPAN> </DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Please dispose of cigarette butts in proper areas, smoking not allowed in any building</SPAN> </SPAN></DIV>
<LI>
<DIV align=justify><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">People who do not follow the rules will be asked to leave immediately</SPAN> </DIV>
</LI></UL></TD></TR></TBODY></TABLE></DIV>
答案 1 :(得分:0)
ul
的样式。像这样:
ul.out{
list-style:disc outside none;
}
答案 2 :(得分:0)
您忘记关闭每个LI标签..
而不是:
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Event will be held from 10am - 5pm Bring Your Dog With</SPAN></SPAN> </DIV>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">$8 Entrance Fee (print out your flyer that you received and bring it with you to support your favorite Rescue (kids under 12 are FREE) $5 of you entrance fee will go to that dog rescue or organization</SPAN></SPAN> </DIV>
顺其自然:
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">Event will be held from 10am - 5pm Bring Your Dog With</SPAN></SPAN> </DIV>
</LI>
<LI>
<DIV align=justify><SPAN style="FONT-SIZE: 14pt"><SPAN style="FONT-FAMILY: Times New Roman; FONT-SIZE: 14pt">$8 Entrance Fee (print out your flyer that you received and bring it with you to support your favorite Rescue (kids under 12 are FREE) $5 of you entrance fee will go to that dog rescue or organization</SPAN></SPAN> </DIV>
</LI>
另外,尝试将标签保持小写。
我不确定,但我相信这是推荐的。
要确保线条继续运行,而不是中断到下一行,请尝试设置:
ul {
overflow: auto;
}
在你的CSS中
答案 3 :(得分:0)
你的代码太可怕了!如果您需要为所有列表项设置类似的样式,请为所有列表项使用通用样式表!内部div和跨度没有理由!
<style type="text/css">
li {
font-size: 14pt;
font-family: "Times New Roman", sans-serif;
}
</style>
<ul>
<li> event will be held from 10am - 5pm bring your dog with</li>
<li> $8 entrance fee (print out your flyer that you received and bring it with you to support your favorite rescue
</li>
(kids under 12 are free) $5 of you entrance fee will go to that dog rescue or organization </li>
<li> must bring current vaccination paperwork, no exceptions, dogs will not be allowed in without this paperwork
</li>
<li> no firearms, alcoholic beverages, outside food or drink, coolers or glass containers</li>
<li> bags will be checked prior to entrance</li>
<li> event will be photographed & videotaped</li>
<li> all dogs must have rabies tags attached to collars</li>
<li> collars must be worn at all times, no metal collars of any kind allowed</li>
<li> owners/handlers are legally responsible for the behavior/actions of their dogs</li>
<li> only 1 dog allowed per adult handler</li>
<li> dogs must be healthy, fully immunized, de-wormed, & wearing id tags</li>
<li> female dogs in heat are not permitted</li>
<li> dogs must be leashed at all times unless in dog play area, owners must watch their dog in this area at all
times
</li>
<li> owners must immediately clean up after their dogs, with a paper or plastic bag</li>
<li> aggressive dogs will be asked to leave</li>
<li> muzzled dogs not allowed</li>
<li> owners must keep their dogs under control at all times</li>
<li> children must be closely supervised</li>
<li> please dispose of cigarette butts in proper areas, smoking not allowed in any building</li>
<li> people who do not follow the rules will be asked to leave immediately</li>
</ul>