課程
/前端開發
/HTML/CSS
/如何用CSS進行網頁布局
我在父盒子中設置了margin:0 auto;右邊的盒子沒有設置寬,為什么不能自適應??s小瀏覽器窗口后,瀏覽器下面出現滾動條。
2016-06-27
源自:如何用CSS進行網頁布局 5-3
正在回答
<!DOCTYPE?html> <html> <head> ????<meta?charset="UTF-8"> ????<title>Document</title> </head> <title>混合布局編程挑戰</title> <style?type="text/css"> body{?margin:0;?padding:0;?font-size:30px;?color:#fff} .top{height:100px;?background:#ccc;} .main{width:1000px;background:red;margin:0?auto;position:relative;} .right{height:500px;background:#9c9;margin-left:210px;} .left{?width:200px;height:500px;background:#000;position:?absolute;left:?0;top:?0;} .foot{height:50px;?background:#ccf;clear:both;?}? </style> </head> <body> <div>top</div> <div> ???? ????<div>left</div> ????<div>right</div> </div> <div>foot</div> </body> </html> 代碼截圖發錯了,這個是代碼。
舉報
用最簡潔的案例教你布局的那些知識,這是前端工程師基本技能
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-06-27