zoukankan      html  css  js  c++  java
  • 三列浮动中间宽度自适应

    二个固定定位,用margin 把左边和右边都让出来。
     
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>三列浮动中间宽度自适应</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            #left{
                border :1px solid red;
                 200px;
              /* height: 200px; */
                height: 100%;
                position: absolute;
                top :0px;
                left :0px;
            }
            #right{
                border :1px solid green;
                 200px;
        /* height: 200px; */
        height: 100%;
                position: absolute;
                top :0px;
                right :0px;
              
            }
            #center{
                background-color: #fcc;
                border:1px solid  black;
                /* height: 200px; */
                height: 100%;
                margin-left:205px;
                margin-right:205px;
                
            }
            .box{
                height:   500px;
                border:1px solid  green;
                position: relative;
            }
        
        
        </style>
    </head>
    <body>
        <div class="box">
            <div id="left"></div>
            <div id="center"></div>
            <div id="right"></div>
        </div>
     
    </body>
    </html>
  • 相关阅读:
    迷の“良心”膜你赛总结*3
    bzoj1704/poj3276[Usaco2007 Mar]Face The Right Way自动转身机
    poj 1840 -- Eqs
    poj 3274 -- Gold Balanced Lineup
    poj 3349 -- Snowflake Snow Snowflakes
    poj 2442 -- Sequence
    BestCoder Round #1 1002 项目管理 (HDU 4858)
    BestCoder Round #1 1001 逃生 (HDU 4857)
    poj 1273 -- Drainage Ditches
    poj 1149 -- PIGS
  • 原文地址:https://www.cnblogs.com/alannever/p/13502458.html
Copyright © 2011-2022 走看看