css兩列等高程式碼例項

antzone發表於2017-04-06

下面分享一段使用css實現的兩列等高效果,程式碼例項如下:

[HTML] 純文字檢視 複製程式碼
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>螞蟻部落</title>
<style type="text/css">
body {
  padding: 0;
  margin: 0;
  color: #f00;
}
.container {
  width: 600px;
  margin: 0 auto;
  border: 3px solid #00c;
  overflow: hidden;
}
.left {
  width: 150px;
  float: left;
  background: #b0b0b0;
  padding-bottom: 2000px;
  margin-bottom: -2000px;
}
.right {
  width: 450px;
  float: left;
  background: #6cc;
  padding-bottom: 2000px;
  margin-bottom: -2000px;
}
#antzone {
  height:200px;
}
</style>
</head>
<body>
  <div class="container">
    <div class="left">螞蟻部落一</div>
    <div class="right">
      <div id="antzone"></div>
    </div>
  </div>
</body>
</html>

相關文章