Skip to content

Instantly share code, notes, and snippets.

@rocketxujia
Created March 30, 2014 23:32
Show Gist options
  • Save rocketxujia/9881743 to your computer and use it in GitHub Desktop.
Save rocketxujia/9881743 to your computer and use it in GitHub Desktop.
双飞翼布局及其他方案
.wrap{
width: 980px;
margin: 20px auto;
background: #f8f8f8;
}
.wrap .main, .wrap .sub, .wrap .secondy{
background: #f0f0f0;
}
.wrap .sub{
height: 300px;
}
/*layout-float*/
.layout-float{
margin-top: 12px;
}
.layout-float:after{
display: table;
height: 0px;
clear: both;
content: "\0020";
}
.layout-float .main-wrap{
float: left;
width: 100%;
}
.layout-float .main{
margin: 0 300px 0 200px;
}
.layout-float .sub{
float: left;
width: 180px;
margin-left: -100%;
margin-right: 20px;
}
.layout-float .secondy{
float: left;
width: 280px;
margin-left: -280px;
}
/*layout-relative*/
.layout-relative{
position: relative;
}
.layout-relative .main{
margin: 0 300px 0 200px;
}
.layout-relative .sub{
position:absolute;
top: 0px;
left: 0px;
width: 180px;
margin-right: 20px;
}
.layout-relative .secondy{
position: absolute;
top: 0px;
right: 0px;
width: 280px;
margin-left: 20px;
}
<div class="wrap layout-float">
<div class="main-wrap">
<div class="main">
main-content
</div>
</div>
<div class="sub">sub</div>
<div class="secondy">secondy</div>
</div>
<div class="wrap layout-relative">
<div class="main">main</div>
<div class="sub">sub</div>
<div class="secondy">secondy</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment