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>
    
  • 相关阅读:
    mysql各版本特点
    jQuery 获取文件后缀的方法
    jquery中动态效果
    常用CSS缩写语法总结
    判断两个时间这间间隔几分钟
    jQuery操作Cookie
    禁止表单自动提示缓存数据
    jQuery.lazyload
    Jquery.Sorttable 桌面拖拽自定义
    分享13款非常有用的 jQuery 插件
  • 原文地址:https://www.cnblogs.com/leyi/p/4752283.html
Copyright © 2011-2022 走看看