首页htmlui_olHTML Element Style - 如何在UI列表上对齐项目

HTML Element Style - 如何在UI列表上对齐项目

我们想知道如何在UI列表上对齐项目。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
li {
  width: 33%;
  border: 1px solid red;
  list-style-type: none;
  display: inline-block;
  width: 33%;
  float: left;
  height: 50px;
  line-height: 50px;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}
</style>
</head>
<body>
  <ul>
    <li>Left</li>
    <li class="center">Centered</li>
    <li class="right">Right</li>
  </ul>
  <ul>
    <li></li>
    <li class="center">Centered</li>
    <li class="right">Right</li>
  </ul>
  <ul>
    <li>Left float</li>
    <li class="center">Centered</li>
    <li class="right"></li>
  </ul>
</body>
</html>