[英]Why does my list go outside the table cell?
當使用相同的 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 或表格或列表 margin-left 設置為 0。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.