當文本變得有點長時,我的黃色格跳下來。 See imagesofproblem。< Div>跳到新行
<html>
<div style="background-color:#00ff00; width:200px;">
<ul style="list-style:none;">
<li><span style="margin-right:5px;">></span><div style="display:inline-block; background-color:yellow;">Hit me! Hit me! -Hit me! -</div> </li>
</ul>
</div>
</html>
我怎樣才能確保黃色div不會跳下來,當文字變長。日誌文本應該會自動變成新行。
(是否有可能不把「寬度」黃色DIV解決這個問題)
你可以設置你的寬度爲'auto'或者只是刪除它,你不想那樣? – Roljhon