天天看點

css實作表單 文字兩端對齊

文字兩端對齊

<div class="form">
  <div>姓名</div>
  <div>手機号碼</div>
  <div>使用者名</div>
  <div>密碼</div>
</div>
<style>
.form div {
  width: 100px;
  height: 30px;
  line-height: 30px;
  margin-bottom: 10px;
  border: 1px solid red;
  text-align-last: justify;
}
</style>
           

效果:

css實作表單 文字兩端對齊