首页htmlui_olHTML Element Style - 如何在UL列表中显示网格

HTML Element Style - 如何在UL列表中显示网格

我们想知道如何在UL列表中显示网格。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.container {
  border: 1px solid #ff0000;
  width: 580px;
}

.container-inner {
  padding: 30px;
}

.row {
  overflow: hidden;
}

ul {
  margin: 0 0 0 -20px;
  padding: 0;
  overflow: hidden;
}

li {
  width: 160px;
  float: left;
  margin: 0 0 0 20px;
  list-style: none;
}

.inner {
  border: 1px solid #ccc;
  padding: 10px;
}
</style>
</head>
<body>
  <div class="container">
    <div class="container-inner">
      <div class="row">
        <ul>
          <li><div class="inner">Item 1</div></li>
          <li><div class="inner">Item 1</div></li>
          <li><div class="inner">Item 1</div></li>
        </ul>
      </div>
    </div>
  </div>
</body>
</html>