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

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

我這個代碼對嗎? 請大神們幫忙看下謝啦

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>混合布局編程挑戰</title>

<style type="text/css">

body{ margin:0; padding:0; font-size:30px; color:#fff}

.top{width:100%;height:200px;background:gray;}

.main{width:100%;height:800px;background:red;}

.left{ width:200px;height:800px;float:left;background:blue;}

.right{width:100%;height:800px;background:green;position:absolute;left:210px;top:200;}

.foot{width:100%;height:200px;background:orange;}

</style>


</head>


<body>

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

<div class="main">

? ? <div class="right">right</div>

? ? <div class="left">left</div>

</div>

<div class="foot">foot</div>


</body>

</html>


正在回答

3 回答

.top{background:#ccc;height:100px;}

.main{background:red;height:600px;}

.left{background:blue;height:600px;width:200px;}

.right{background:yellow;height:600px;width:100%;left:210px;position:absolute;}

.foot{background:orange;height:50px;}

這是我測試的最少代碼實現了,疑問或錯誤歡迎指出~!

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

對是對了但是有點不好看==

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

鯊鼻叔叔 提問者

那應該怎么完善一下呀拜托啦
2016-12-28 回復 有任何疑惑可以回復我~

right直接float:right;即可,不需要絕對定位

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

EricZoo

親測float:right不行,若設置float,當width:100%時會鋪滿,用絕對定位隱性成的內聯塊狀元素就可以設置左邊距之后以width100%來自適應屏幕
2017-02-22 回復 有任何疑惑可以回復我~

舉報

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

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

進入課程

我這個代碼對嗎? 請大神們幫忙看下謝啦

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

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

幫助反饋 APP下載

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

公眾號

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