码迷,mamicode.com
首页 > 其他好文 > 详细

!代码:页面布局

时间:2015-10-29 11:00:19      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:

多列:

<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>

 

 

 

...

!代码:页面布局

标签:

原文地址:http://www.cnblogs.com/qq21270/p/4919583.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!