CSS解决高度自适应问题

it2025-01-29  19

HTML结构如下:

< div  id="main">      < div  id="top">top</ div >      < div  id="body">body</ div > </ div > #top { background-color: green; width: 100%; height: 50px; } #body { background-color: red; width: 100%; position: absolute; top: 50px; bottom: 0px; left: 0px; }

  重点是要top和bottom一起使用,可以强制定义盒模型的区域

 

转载于:https://www.cnblogs.com/harryhan1983/p/5763940.html

相关资源:数据结构—成绩单生成器
最新回复(0)