主要使用css3属性

text-align: justify;

text-align-last: justify;

上代码:

<ul>
        <li>
            <label class="mark">用户名</label>
            <div>
                <input type="text" id="form-name" />
            </div>
        </li>
        <li>
            <label class="mark">验证码</label>
            <div>
                <input type="text" id="form-verifiy" />
            </div>
        </li>
        <li>
            <label class="mark">密码</label>
            <div>
                <input type="text" id="form-password" />
            </div>
        </li>
        <li>
            <label class="mark">确认密码</label>
            <div>
                <input type="text" id="form-sure_pass" />
            </div>
        </li>
    </ul>
li {

    clear: both;

    list-style: none;

}

 

.mark {

    display: block;

    float: left;

    overflow: hidden;

    width: 78px;

    height: 29px;

    padding-right: 10px;

    text-align: justify;

    text-align-last: justify;

}


效果展示:
实现表单label两端对齐

 



 

相关文章:

  • 2021-11-21
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案