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

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

為什么就是無法自適應?

為什么就是無法自適應?

斷橋丶曉風殘月 2016-08-26 18:16:33
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <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;width:100%} .top{height:50px;background:#ccc} .main{width:100%;height:600px;background:pink;margin:0 auto;} .left{ width:200px;background:#f90;height:600px;float:left} .right{background:#9f9;height:600px;margin-left:210px;position:absolute;width:100%} .foot{height:50px;background:#fcc;} /*任務1:完成頂部(top)、底部(foot)寬度自適應 任務2:中間分為2兩欄,其中,左側(left)寬度為200px, 右側(right)寬度自適應 任務3:要求右側(right)先加載,左側(left)后加載 任務4:編寫的代碼要兼容ie6*/ </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 回答

已采納
?
woshiajuana

TA貢獻211條經驗 獲得超152個贊

像你這種定位方法的話,錯誤有三:

1、布局錯誤,right和left的位置

2、.right{background:#9f9;height:600px;margin-left:210px;position:absolute;width:100%}中不能給絕對定位,一絕對定位就脫離了文檔流

3、還是上面那句,right不能給width為100%,這樣會讓right的寬度等于main的寬度

查看完整回答
反對 回復 2016-08-27
?
alohaXL

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

請問這是哪個課程?
查看完整回答
反對 回復 2016-12-07
?
woshiajuana

TA貢獻211條經驗 獲得超152個贊

<!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;width:100%}
? ? ? ?.top{height:50px;background:#ccc}
? ? ? ?.main{width:100%;height:600px;background:pink;margin:0 auto;}
? ? ? ?.left{ width:200px;background:#f90;height:600px;float:left}
? ? ? ?.right{background:#9f9;height:600px;margin-left:210px;}
? ? ? ?.foot{height:50px;background:#fcc;}
? ? ? ?/*任務1:完成頂部(top)、底部(foot)寬度自適應
? ? ? ?任務2:中間分為2兩欄,其中,左側(left)寬度為200px, 右側(right)寬度自適應
? ? ? ?任務3:要求右側(right)先加載,左側(left)后加載
? ? ? ?任務4:編寫的代碼要兼容ie6*/
? ?</style>

</head>

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

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

</body>
</html>

查看完整回答
反對 回復 2016-08-27
  • 3 回答
  • 1 關注
  • 2007 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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