zoukankan      html  css  js  c++  java
  • 圣杯和双飞翼布局

    //圣杯布局-wrap设置padding/left right加相对定位

    <!DOCTYPE html>
    <html lang="zh-CN">
    <html>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title></title>
        <style>
            *{margin:0; padding:0;}
            .wrap{padding:0 200px; overflow: hidden}
            .main{100%; background:#57ccb1; float:left; height:100px;}
            .left{ float:left;margin-left:-100%;  200px; height:100px; background:#ff3f27; position:relative; left:-200px;}
            .right{ float:left;margin-left:-200px;  200px; height:100px; background:#fbb800; position:relative;right:-200px;}
        </style>
    </head>
    <body>
    
    <div class="wrap">
        <div class="main">main</div>
        <div class="left">left</div>
        <div class="right">right</div>
    </div>
    
    </body>
    </html>
    

    //双飞翼布局-在main中嵌套一层设置margin

    <!DOCTYPE html>
    <html lang="zh-CN">
    <html>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title></title>
        <style>
            *{margin:0; padding:0;}
            .main{100%; background:#57ccb1; float:left; height:100px;}
            .left{ float:left;margin-left:-100%;opacity:0.4;  200px; height:100px; background:#ff3f27; }
            .right{ float:left;margin-left:-200px;opacity:0.4;  200px; height:100px; background:#fbb800; }
            .main_con{margin-left:200px; margin-right:200px;}
        </style>
    </head>
    <body>
    
    <div class="wrap">
        <div class="main">
            <div class="main_con">main</div>
        </div>
        <div class="left">left</div>
        <div class="right">right</div>
    </div>
    
    </body>
    </html>
    
  • 相关阅读:
    【python】元组
    【python】列表
    1-读书的网站
    35-Python
    34-TypeError: BoxSizer.AddSpacer(): argument 1 has unexpected type 'tuple'
    33-wxpython多个frame之间的信息共享
    32-python代码打包成exe文件-pyinstaller
    31-字符串转为 url 格式的两种不同情况
    30-python3 中 bytes 和 string 之间的互相转换
    9-eclispe中右键BuildPath没有了
  • 原文地址:https://www.cnblogs.com/leyi/p/4752283.html
Copyright © 2011-2022 走看看