簡體   English   中英

為什么我的列表 go 在表格單元格之外?

[英]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&#45;<span class="rightindent">dom&#44; write the name of the</span><span class="rightindent">County&#44; and Town or Parish&#46;</span></li> <li>If born in any other part of<span class="rightindent">the British Empire&#45; write</span><span class="rightindent">the name of the Dependency&#44;</span><span class="rightindent">Colony&#44; etc&#46;&#44; and of the</span><span class="rightindent">Province or State&#46;</span></li> <li>If born in a Foreign Country&#44;<span class="rightindent">write the name of the Country&#46;</span></li> <li>If born at sea&#44; write &ldquo;At Sea&#46;&rdquo;</li> </ul> <p class="birthplaceblock1911">NOTE&#46;&mdash;In the case of persons<span>born elsewhere than in England or</span><span>Wales&#45; state whether &ldquo;Resident&rdquo; or</span><span>&ldquo;Visitor&rdquo; in this Country&#46;</span></p> </td>

如果我刪除邊距,那么它可以正常工作,但會將列表發送到第一頁的左側。

無論如何,我認為表格單元格應該擴展以獲取項目的文本。

有人可以幫忙嗎?

我確實知道我需要下面的第二個列表,該列表從第 3 位開始,但我可以處理這個。

謝謝

我建議您可能應該檢查是否將表格放入 div 中。 因為可能文本綁定到 div 並且 div 比表格大。

該解決方案適用於我的網站https://www.tradebyb.com

編輯:可能將 div 或表格或列表 margin-left 設置為 0。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM