Skip to content

Instantly share code, notes, and snippets.

@cheng470
Last active August 29, 2015 14:07
Show Gist options
  • Save cheng470/25e8b1f6f091385ea5e3 to your computer and use it in GitHub Desktop.
Save cheng470/25e8b1f6f091385ea5e3 to your computer and use it in GitHub Desktop.
流式三列布局
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body {
text-align: center;
}
.wrapper {
width: 76.8%;
margin: 0 auto;
text-align: left;
max-width: 125em; /*确保文本的长度适合阅读*/
min-width: 62em;
}
.content .primary {
width: 72.8%;
float: right;
display: inline;/*防止IE中的双外边距浮动产生的bug*/
}
.content .secondary {
width: 25%;
float: left;
display: inline;
}
.content .primary .primary {
width: 59.7%;
float: left;
display: inline;
}
.content .primary .secondary {
width: 34.33%;
padding-right: 2.63%;
float: right;
display: inline;
}
.wrapper, .primary, .secondary {
border: 1px solid;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="header">
<h1>Header</h1>
</div>
<div class="content">
<div class="primary">
<div class="primary">
<p>primary</p>
</div>
<div class="secondary">
<p>secondary</p>
</div>
</div>
<div class="secondary">
<p>secondary</p>
</div>
</div>
<div class="footer">
<p>footer</p>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment