HTML和CSS经典布局1
如下图:
需求:
1. 如图
2. 可以从body标签开始。

1 <!DOCTYPE html> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title></title> 5 <style> 6 .section-inner { 7 width: 970px; 8 min-height: 500px; 9 margin: 30px auto; 10 } 11 </style> 12 </head> 13 <body> 14 <div id="header" style="height: 50px; background: blue;"> 15 16 </div> 17 <div id="content"> 18 <div class="section-inner" style="background-color: yellow;"> 19 20 </div> 21 </div> 22 </body> 23 </html>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】博客园2025新款「AI繁忙」系列T恤上架,前往周边小店选购
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步