1 foot固定底部 但是子類內容高度大于100%會隨著下移2 子類最小高度100% (所以body需要設置高度)3 foot和body是兄弟關系? 不可以包在body里??
1 回答

業余奶茶品鑒師
TA貢獻260條經驗 獲得超388個贊
<!DOCTYPE?html> <html?lang="en"> <head> ????<meta?charset="UTF-8"> ????<meta?name="viewport"?content="width=device-width,?initial-scale=1.0"> ????<meta?http-equiv="X-UA-Compatible"?content="ie=edge"> ????<title>Document</title> ????<style> ????*?{??????????? ????????padding:?0;??????????? ????????margin:?0;??????? ????}??????? ????.body?{??????????? ????????background:?green;??????????? ????????width:?100%;??????????? ????????min-height:?96%;??????? ????}??????? ????.foot?{??????????? ????????background:?orange;??????????? ????????width:?100%;??????????? ????????height:?4%;???????? ????}??????? ????.child?{??????????? ????????width:?40%;??????????? ????????height:?1000px;??????????? ????????background:?red;??????? ????}??? ????</style> </head> <body> <div?class="main"> ????<div?class="body"> ????????<div?class="child"></div> ????</div> ????<div?class="foot"></div> ????</div> </body> </html>
采納下吧
點擊展開后面3條
- 1 回答
- 0 關注
- 1028 瀏覽
添加回答
舉報
0/150
提交
取消