DIV+CSS上中下布局案例

<!DOCTYPE html><html> <head> <Meta charset="UTF-8"> <title>上中下DIV+CSS布局案例</title> <style type="text/css"> #container{ background-color: darkgray; text-align: center; width: 800px; height: 600px; } #top{ background-color: antiquewhite; width: 780px; height: 100px; } #main{ background-color: #00FF00; width: 780px; height: 400px; } #bottom{ background-color: aqua; width: 780px; height: 100px; } </style> </head> <body> <!--需要兼容客户屏幕宽度,布局应该使用固定尺寸--> <!--p,h,div属于块状元素,前后会自动换行--> <!--div会自动占据整个父容器的宽度--> <center> <div id="container"> <center> <div id="top">TOP</div> <div id="main">MAIN</div> <div id="bottom">BottOM</div> </center> </div> </center> </body></html>

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些