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

為了賬號安全,請及時綁定郵箱和手機立即綁定

請看看我的代碼有什么問題~

<html>

<style?type="text/css">

.top{height:100px;background:blue;top:0;margin:0?auto;}

.head{background:#ff7a56;height:100px;width:500px;margin:0?auto;}

.left{width:100px;height:500px;float:left;background:grey;}

.main{height:500px;margin:0?auto;background:pink;top:0;}

.right{width:100px;height:500px;float:right;background:#ededed;}

</style>

<div?class="top">
<div?class="head"></div>
</div>

<div?class="left">啦啦啦</div>
<div?class="main">123</div>
<div?class="right">456</div>

</html>

請問為什么我最右邊的分欄“456”會跑到下面去~

正在回答

1 回答

.main{height:500px;margin:0?auto;background:pink;top:0;}? 這個里面的margin不能這么寫,你可以直接給mian寫一個寬度,加一個float:left; 你在;兩個浮動之間寫margin沒用,可以試試這樣.main{height:500px; width:500px; float: left;background:pink;top:0;}


0 回復 有任何疑惑可以回復我~
#1

彭沛兔 提問者

謝謝!
2016-07-06 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
如何用CSS進行網頁布局
  • 參與學習       209566    人
  • 解答問題       1206    個

用最簡潔的案例教你布局的那些知識,這是前端工程師基本技能

進入課程

請看看我的代碼有什么問題~

我要回答 關注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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