我有一个列表,当使用相同的CSS时,它在一个表中看起来很好,但在一秒钟内就不好了。
它在这个网页上运行良好:http://c5d.co.uk/kimmeridge1911.php
但在这一页上,文本超出了框。http://c5d.co.uk/infirmary1911.php
HTML是
.birthplace {
margin: 0 auto;
padding: 0;
list-style: none;
counter-reset: section;
line-height: 1.2;
text-align: left;
font-size: small;
width: 90%;
}
.birthplace li span {
display: block;
text-indent: 15px;
}
.birthplace li:before {
counter-increment: section;
content: "("counter(section)")";
margin-right: 5px;
}
.birthplace span {
text-align: left;
display: block;
margin-left: 5%
}
<td rowspan="3">
<ul class="birthplace">
<li>If born in the United King-<span class="rightindent">dom, write the name of the</span><span class="rightindent">County, and Town or Parish.</span></li>
<li>If born in any other part of<span class="rightindent">the British Empire- write</span><span class="rightindent">the name of the Dependency,</span><span class="rightindent">Colony, etc., and of the</span><span class="rightindent">Province or State.</span></li>
<li>If born in a Foreign Country,<span class="rightindent">write the name of the Country.</span></li>
<li>If born at sea, write “At Sea.”</li>
</ul>
<p class="birthplaceblock1911">NOTE.—In the case of persons<span>born elsewhere than in England or</span><span>Wales- state whether “Resident” or</span><span>“Visitor” in this Country.</span></p>
</td>
如果我去掉页边空白,那么它在一页中运行良好,但会将列表发送到第一页的左侧。
无论如何,我认为表单元格应该展开,以接受项目的文本。
有人能帮忙吗?
我知道我需要第二个从第3号开始的列表,但我可以处理这个。
感谢
我建议您可能应该检查是否将表放在div中。因为可能文本与div绑定,并且div比表大。
这个解决方案在我的网站上运行,https://www.tradebyb.com
编辑:可以将div或表或列表的左边距设置为0。