亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

html中的float

html中的float

街角瘋 2017-02-15 15:53:35
<!doctype?html><html?>?????<head>?????????<meta?charset="UTF-8">?????????<meta?name="Keywords"?content="">?????????<meta?name="Description"?content="">?????????<title></title> ?<style?type="text/css"> *{margin:0;?padding:0;} .box{ background-color:#6699cc; width:900px; height:500px; margin:0?auto; } .left{ background-color:#ff0066; width:300px; height:200px; float:left; } .right{ background-color:#ffff00; width:580px; height:200px; float:right; } .bottom{ background-color:#000000; width:900px; height:300px; } ?</style>????</head><body> ????<div?class="box">????????? <div?class="left"></div>? ????????<div?class="right"></div>????????? <div?class="bottom"></div> ????</div>?</body></html>為什么這個float中 bottom所代表的那個盒子會在left right兩個盒子的下面,然而在bottom中添加clear:both;就能使bottom那個盒子移動到底部了
查看完整描述

3 回答

?
我姓蔣

TA貢獻2條經驗 獲得超0個贊

浮動有點類似于z-index:9(就是脫離底層的意思)
查看完整回答
反對 回復 2017-02-16
?
學習js

TA貢獻85條經驗 獲得超55個贊


元素浮動之后,周圍的元素會重新排列,為了避免這種情況,使用 clear 屬性。

查看完整回答
反對 回復 2017-02-15
  • 3 回答
  • 0 關注
  • 1670 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號