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

    经典布局案例


    双飞翼布局

    一般用于三栏布局,左右两栏相等,等比例缩放

    <style>
    	body{margin:0px;}
    	.container{ 100%;overflow:hidden;}
    	.container div{float: left; min-height: 200px;margin-bottom:-9999px;
    		padding-bottom:9999px;}
    	.container .main{ 100%; }
    	.container .main div{margin: 0 120px;background: #ccc;float: none;margin-bottom: -9999px;}
    	.container .left{ 100px; margin-left:-100% ;background: red;}
    	.container .right{ 100px;margin-left:-100px;background-color: blue;}
    </style>
    <body>
    	<div class="container">
    		<div class="main">
    			<div>
    				中间
    			</div>
    		</div>
    		<div class="left">左边</div>
    		<div class="right">右边</div>
    	</div>
    </body>
    

    圣杯布局

    一般用于三栏布局,左右不相等,中间等比例缩放

    <style>
    	body{margin: 0px;}
    	.container{padding: 0 200px 0 100px;}
    	.container div{float: left;height: 400px;position: relative;}
    	.container .main{ 100%;background: #ccc;}
    	.container .left{ 100px;left: -100px;margin-left: -100%;background-color: red;}
    	.container .right{ 200px; left: 200px; margin-left: -200px;background: blue;}
    </style>
    <body>
    	<div class="container">
    		<div class="main">中间</div>
    		<div class="left">左边</div>
    		<div class="right">右边</div>
    	</div>
    </body>
    
  • 相关阅读:
    matlab2016b和c# .net4.0混合编程
    有限元入门
    math.net 拟合
    excel 错误提示以及其他基础知识
    excel的小bug
    Servlet体系及方法
    Servlet学习笔记
    HTTP协议
    Tomcat
    反射
  • 原文地址:https://www.cnblogs.com/lovecode3000/p/12422269.html
Copyright © 2011-2022 走看看