css代码如下:
/**
* 多列等高
*
* @param
* @arrange (512.笔记) jb51.cc
**/
#header
{
background-color: gray;
height: 100px;
width: 960px;
}
#container-1,#container-2,#container-3
{
position: relative;
float: left;
}
#container-1
{
overflow: hidden;
width: 960px;
margin-top: 10px;
background-color: red;
}
#container-2
{
background-color: green;
left: 240px;
}
#container-3
{
float: left;
background-color: blue;
left: 480px;
}
#main,#primary,#secondary
{
display: inline;
margin: 0 10px;
position: relative;
float: left;
}
#main
{
width: 460px;
right: 50%;
}
#primary
{
width: 220px;
right: 125%;
}
#secondary
{
right: 75%;
width: 220px;
}
HTML代码如下:
<div id="header"></div>
<div id="container-1">
<div id="container-2">
<div id="container-3">
<div id="main">Main<br />Main</div>
<div id="primary">Primary</div>
<div id="secondary">Secondary</div>
</div>
</div>
</div>
<div style="clear: left">
</div>
原文链接:https://www.f2er.com/html/527533.html