使用了浮動模型后,如何讓下一個元素不浮動?
<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之后了,并不是另起一行,怎么回事呀?
2019-12-09
<div style="clear:both" ></div>
2019-09-16
maybe you can try again