• !代码:页面布局


    http://www.cnblogs.com/depsi/p/5097013.html  CSS两列及三列自适应布局方法整理  2015-1-4

    多列:

    <style type="text/css">
    html,body{margin:0;padding:0;}
    .main{width:1190px;margin-left:0;margin-right:0;min-height:1000px;background:#000;}
    .product {position:relative;float:left;background:#fff;margin:0 20px 20px 0;overflow:visible;}
    .product:nth-child(4n) {margin-right:0;}
    .iwrap {position:relative;width:280px;height:300px;background:#fff;margin:0;padding:0;border:1px solid #ececec;box-sizing:content-box;}
    </style>
    <div class="main">
        <div class="product"><div class="iwrap">1111</div></div>
        <div class="product"><div class="iwrap">22222</div></div>
        <div class="product"><div class="iwrap">3333</div></div>
        <div class="product"><div class="iwrap">4444</div></div>
        <div class="product"><div class="iwrap">1111</div></div>
        <div class="product"><div class="iwrap">22222</div></div>
        <div class="product"><div class="iwrap">3333</div></div>
        <div class="product"><div class="iwrap">4444</div></div>
    </div>

    多列红框:

    <style type="text/css">
    html,body{margin:0;padding:0;}
    .main{width:1190px;margin-left:0;margin-right:0;min-height:1000px;background:#999;}
    .product {position:relative;float:left;background:#fff;width:282px;height:333px;margin-right:20px;margin-bottom:20px;line-height:1.5;overflow:visible;z-index:1;}
    .product:nth-child(4n) {margin-right:0;}
    .product:hover{overflow:visible;z-index:3;}
    .product:hover .iwrap {
        margin:-3px;
        border:4px solid #f83760;
        -webkit-transition:border-color .2s ease-in;
        -moz-transition:border-color .2s ease-in;
        -ms-transition:border-color .2s ease-in;
        -o-transition:border-color .2s ease-in;
        transition:border-color .2s ease-in;
    }
    .iwrap {position:relative;width:280px;height:331px;background:#fff;margin:0;padding:0;border:1px solid #ececec;box-sizing:content-box;}
    </style>
    <div class="main">
        <div class="product"><div class="iwrap">1111</div></div>
        <div class="product"><div class="iwrap">22222</div></div>
        <div class="product"><div class="iwrap">3333</div></div>
        <div class="product"><div class="iwrap">4444</div></div>
    
        <div class="product"><div class="iwrap">1111</div></div>
        <div class="product"><div class="iwrap">22222</div></div>
        <div class="product"><div class="iwrap">3333</div></div>
        <div class="product"><div class="iwrap">4444</div></div>
    </div>

    ...

  • 相关阅读:
    python 类继承演示范例的代码
    C#监控指定目录的文件变化的代码
    如何开启红米手机4X的ROOT超级权限
    C# 发送电子邮件源码片段
    android中使用afinal一行源码显示网络图片
    (详细)华为畅享7 SLA-AL00的usb调试模式在哪里打开的流程
    C#自定义FTP访问类的代码
    C#的String.Split 分割字符串用法详解的代码
    红米Note 5A完美卡刷开发版获得ROOT超级权限的方法
    C# 类如何声明索引器以提供对类的类似数组的访问的代码
  • 原文地址:https://www.cnblogs.com/qq21270/p/4919583.html
Copyright © 2020-2023  润新知