首页htmltwo_columnCSS Layout - 如何创建两列布局与绝对定位

CSS Layout - 如何创建两列布局与绝对定位

我们想知道如何创建两列布局与绝对定位。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#wrapper {
  width: 100%;
  height: 100px;
  border: 1px dotted gray;
  position: relative;
}

#left {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 200px;
  background-color: blue;
}

#right {
  position: absolute;
  left: 0;
  right: 210px;
  top: 0;
  bottom: 0;
  background-color: #5a71e5;
}
</style>
</head>
<body>
  <div id="wrapper">
    <div id="left"></div>
    <div id="right"></div>
  </div>
  <p>And more content can follow...</p>
</body>
</html>