首页htmltwo_columnCSS Layout - 如何创建两个具有分隔符的列布局,其中总宽度小于100%

CSS Layout - 如何创建两个具有分隔符的列布局,其中总宽度小于100%

我们想知道如何创建两个具有分隔符的列布局,其中总宽度小于100%。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.container {
  border: 1px solid red;
  overflow: auto;
  margin: 10px 0;
}

.container .LC {
  width: 50%;
  margin: 0 -1em;
  float: left;
  background-color: yellow;
  border-right: 1em solid blue;
}

.container .RC {
  width: 50%;
  float: left;
  background-color: cyan;
  border-left: 1em solid blue;
}
.small {
  width: 60%;
  margin: 10px auto;
}
</style>
</head>
<body>
  <div class="container small">
    <div class="LC">Left</div>
    <div class="RC">Right</div>
  </div>
</body>
</html>