开发者社区> 问答> 正文

请问css布局整个窗口上下布局

上面270px
下面自适应
请问怎么写?

展开
收起
杨冬芳 2016-06-02 10:42:44 1664 0
1 条回答
写回答
取消 提交回答
  • IT从业
    <!DOCTYPE html>
    <html>
      <head>
        <style>
        html,body {
          margin: 0;
          padding: 0;
        }
        .top {
            height: 270px;
        }
        .bottom {
            position: absolute;
            top: 270px;
            bottom: 0;
            left: 0;
            right: 0;
            height: auto;
            width: auto;
        }
        </style>
      </head>
      <body>
        <div class="top" style="background: red;"></div>
        <div class="bottom" style="background: blue;"></div>
      </body>
    </html>

    screenshot

    2019-07-17 19:24:14
    赞同 展开评论 打赏
问答分类:
问答地址:
相关产品:
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载