2012-01-04 22 views
4

請參閱demo。如何li不包裝到下一行?爲什麼內聯列表項不能換行?

我不在尋找解決方案,因爲有幾個,他們的工作。但我想知道爲什麼它不包裝。

the spec中找不到任何關於它的內容(或者我沒有看到它)。

此問題與我給出的答案here有關。

+1

http://www.w3.org/TR/CSS2/visuren.html#inline-formatting – Sparky 2012-01-04 17:36:22

回答

12

它們之間沒有空白。

這聽起來很奇怪,因爲瀏覽器應該能夠在元素之間進行分解,但是使用display: inline;將元素轉換爲「單詞」。在這種情況下,瀏覽器「看到」

americaaustraliabannercabalcomputerfamilygeneralgwholsisraellastchaosmepeterpanphotospotbsPoTBSpsorforyzomtantratattoostemplatestravelweb_designwowmjboxquakeliveSpain_2011Sanatorio_de_Turberculososseverallsseveralls2bush_boake_allenodeon-colchestermoredartford 

並且它不知道如何拆分這個怪物單詞。

+0

+1 - 想象它有一個非常長的句子,沒有空格。沒有什麼地方可以折斷! – mrtsherman 2012-01-04 17:30:44

+0

Aha當然是因爲它被設置爲'inline',它們之間必須有一個'whitespace'。好決定。 – PeeHaa 2012-01-04 17:31:24

相關問題