Last active
August 29, 2015 14:07
-
-
Save cheng470/6b15922fb0da9e265a66 to your computer and use it in GitHub Desktop.
固定宽度的两列布局
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
body { | |
text-align: center; | |
} | |
.wrapper { | |
width: 920px; | |
margin: 0 auto; | |
text-align: left; | |
border: 1px solid; | |
} | |
.content .primary { | |
width: 650px; | |
padding-right: 20px; | |
float: right; | |
display: inline;/*防止IE中的双外边距浮动产生的bug*/ | |
border: 1px solid; | |
} | |
.content .secondary { | |
width: 230px; | |
float: left; | |
display: inline; | |
border: 1px solid; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="wrapper"> | |
<div class="header"> | |
<h1>Header</h1> | |
</div> | |
<div class="content"> | |
<div class="primary"> | |
<p>primary</p> | |
</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