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上,然后就正常显示~

  • 相关阅读:
    一文搞懂字符集
    机器视觉之eVision
    PID调节
    激光切割质量主要影响因素
    155. 最小栈
    111.二叉树最小深度
    110. 平衡二叉树
    108.将有序数组转换为二叉搜索树
    107. 二叉树的层次遍历 II
    104. 二叉树的最大深度
  • 原文地址:https://www.cnblogs.com/beng/p/2993725.html
Copyright © 2011-2022 走看看