zoukankan      html  css  js  c++  java
  • 布局

    学会一种新的布局方式:

    1、

    <style>
    body{ margin:0; padding:0;}
    .main{ 960px; margin:0 auto;}
    .center{ float:left; border:1px solid blue; 100%;}
    .render{ margin:0 210px; border:1px solid #966;height:200px;}
    .left{ float:left; border:1px solid black; height:200px; 200px; overflow:visible; margin-left:-100%;}
    .right{ float:left; border:1px solid black; height:200px; 200px; overflow:visible; margin-left:-202px;}
    .clr{ zoom:1;}
    .clr:after{ display:block; content:""; clear:both;}
    </style>
    </head>

    <body>
    <div class="main clr">
    <div class="center">
    <div class="render">
    </div>
    </div>
    <div class="left" style="background:blue;"></div>
    <div class="right" style="background:red;"></div>
    </div>
    </body>

    2、

    <style>
    body{ margin:0; padding:0;}
    .main{ 760px; margin:0 auto;}
    .center{ float:left; border:1px solid blue; 100%;}
    .render{ margin-left:210px; border:1px solid #966;height:200px;}
    .left{ float:left; border:1px solid black; height:200px; 200px; overflow:visible; margin-left:-100%;}
    .clr{ zoom:1;}
    .clr:after{ display:block; content:""; clear:both;}
    </style>
    </head>

    <body>
    <div class="main clr">
    <div class="center">
    <div class="render">
    </div>
    </div>
    <div class="left" style="background:blue;"></div>
    </div>
    </body>

    *最后才发现在ie6下   左边是不显示的,   然后在最外边又套了一个div,.main上的宽度去掉并添加到外面的div上,然后就正常显示~

  • 相关阅读:
    JAVA理解逻辑程序的书上全部重要的习题
    体检套餐管理系统的综合版
    一路奔跑,一路寻找
    员工考勤信息管理小程序
    枚举的独特强大之处
    C#中HashTable的用法
    项目经理评分
    若想成功,请记住!
    数组的经典例子
    S1的小成果:MyKTV系统
  • 原文地址:https://www.cnblogs.com/beng/p/2993725.html
Copyright © 2011-2022 走看看