div not floating along the preceding div with float property set to left
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Which CSS rules explain the following sceanrio: Assuming I have the following HTML CSS snippets HTML: <div id="main"> <div id="first"> first div float left </div> <div id="second"> second div does not have a float property set and appears in a new line instead of next to the first div </div> </div> CSS: #first float: left What I am wondering about is, why the second div floats next to the first div, only when its width is set. If I replace the second div with a paragraph, it also floats next the first div. So why does the second div only