首页htmlpaddingCSS Layout - 如何避免换行填充

CSS Layout - 如何避免换行填充

我们想知道如何避免换行填充。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.Foo {
  display: inline-block;
  width: 25%;
  background-color: lime;
}

.Bar {
  display: inline-block;
  width: 25%;
  background-color: orange;
}
</style>
</head>
<body>
  <div class="Foo">
    <p>This is Foo.</p>
  </div>
  <div class="Bar">
    <p>This is Bar.</p>
  </div>
  <br>
  <br>
  <div class="Foo">
    <p>This is Foo.</p>
  </div>
  <div class="Bar">
    <p>This is Bar.</p>
  </div>  <div class="Foo">
    <p>This is Foo.</p>
  </div>
  <div class="Bar">
    <p>This is Bar.</p>
  </div>
  <br>
  <br>
  <div class="Foo">
    <p>This is Foo.</p>
  </div>
  <div class="Bar">
    <p>This is Bar.</p>
  </div>
</body>
</html>