使用了浮動(dòng)模型后,如何讓下一個(gè)元素不浮動(dòng)?
<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>??/*?實(shí)現(xiàn)靠左浮動(dòng)?*/
????????<span?class="red">float:right;</span>?/*?實(shí)現(xiàn)靠右浮動(dòng)?*/????????
????}
????<div?id="div1"></div>
????<div?id="div2"></div>
????????</pre>
????????</div>
????????<div?id="div2"><img?src="../img/浮動(dòng)模型左靠.jpg"?width="300px"></div>
????????<div?style="float:?none"></div>
????????<br?/>
????????<h3>7.1.3?層模型</h3>
????????<p>層模型就像Photoshop的圖層精準(zhǔn)定位一樣,分為三種形式:</p>
????????<ol>
????????????<li><strong>絕對(duì)定位</strong>(positioning:absolute)</li>
????????????<li><strong>相對(duì)定位</strong>(positioning:relative)</li>
????????????<li><strong>固定定位</strong>(positioning:fixed)</li>
????????</ol>
</body>
我實(shí)現(xiàn)了兩塊div的并行浮動(dòng),但是后面的文本和序列繼續(xù)并列在div之后了,并不是另起一行,怎么回事呀?
2019-12-09
<div style="clear:both" ></div>
2019-09-16
maybe you can try again