<head>
<style type="text/css">
div{float: left;}
</style>
</head>
<body>
<div id="div1">
<pre class="mycode" style=width:300px>
div{
width:200px;
height:200px;
border:2px solid red;
<span class="red">float:left;</span> /* 实现靠左浮动 */
<span class="red">float:right;</span> /* 实现靠右浮动 */
}
<div id="div1"></div>
<div id="div2"></div>
</pre>
</div>
<div id="div2"><img src="../img/浮动模型左靠.jpg" width="300px"></div>
<div style="float: none"></div>
<br />
<h3>7.1.3 层模型</h3>
<p>层模型就像Photoshop的图层精准定位一样,分为三种形式:</p>
<ol>
<li><strong>绝对定位</strong>(positioning:absolute)</li>
<li><strong>相对定位</strong>(positioning:relative)</li>
<li><strong>固定定位</strong>(positioning:fixed)</li>
</ol>
</body>
我实现了两块div的并行浮动,但是后面的文本和序列继续并列在div之后了,并不是另起一行,怎么回事呀?
<div style="clear:both" ></div>
maybe you can try again