zoukankan      html  css  js  c++  java
  • CSS---左右固定,中间自适应布局

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title>宽度自适应布局</title>
            <style>
                .wrap {
                    background-color: #D66464;
                }
                .clearfix:after {
                    content: "";
                    clear: both;
                    display: block;
                }
                .left {
                    float: left;
                     100px;
                    background: #00f;
                    height: 180px;
                }
                .right {
                    float: right;
                     150px;
                    background: #0f0;
                    height: 200px;
                }
                .center {
                    background: #FFFFFF;
                    margin-left: 110px;
                    margin-right: 160px;
                    height: 150px;
                }
            </style>
        </head>
        <body>
            <div class="wrap clearfix">
                <div class="left">left,宽度固定,高度可固定也可以由内容撑开。</div>
                <div class="right">right,宽度固定,高度可固定也可以由内容撑开。</div>
                <div class="center">center,可以自适应浏览器宽度,高度可固定也可以由内容撑开。</div>
            </div>
        </body>
    </html>
    
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8" />
            <title>宽度自适应布局</title>
            <style>
                .wrap {
                    background-color: #FBD570;
                    margin-left: 100px;
                    margin-right: 150px;
                }
                .clearfix:after {
                    content: "";
                    clear: both;
                    display: block;
                }
                .left {
                    float: left;
                     100px;
                    background: #00f;
                    height: 180px;
                    margin-left: -webkit-calc(-100% - 100px);
                    margin-left: -moz-calc(-100% - 100px); 
                    margin-left: calc(-100% - 100px); //减号两边必须有空格         
                }
                .right {
                    float: right;
                     150px;
                    background: #0f0;
                    height: 200px;
                    margin-right: -150px;
                }
                .center {
                    background: #B373DA;
                    height: 150px;
                    float: left;
                     100%;
                }
            </style>
        </head>
        <body>
            <div class="wrap clearfix">
                <div class="center">center,可以自适应浏览器宽度,高度可固定也可以由内容撑开。</div>
                <div class="left">left,宽度固定,高度可固定也可以由内容撑开</div>
                <div class="right">right,宽度固定,高度可固定也可以由内容撑开</div>
            </div>
        </body>
    </html>
    
  • 相关阅读:
    Backtrader中文笔记之Position(持仓情况)
    Backtrader中文笔记之Broker(券商,经纪人)
    Backtrader中文笔记之Orders
    Backtrader中文笔记之Order Management and Execution ---几种价格限制交易的详细解释
    Backtrader中文笔记之Observers and Statistics
    Backtrader中文笔记之Analyzers Reference
    Backtrader中文笔记之Pyfolio Integration(待看)
    Backtrader中文笔记之PyFolio Overview
    curl basic
    plant template
  • 原文地址:https://www.cnblogs.com/beast-king/p/5424742.html
Copyright © 2011-2022 走看看