css实现文字两端对齐

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
      span{
        width: 100px;
        display: inline-block;
        height: 30px;
        line-height: 30px;
        vertical-align: middle;
        text-align: justify;
      }
      span::after{
        content: '';
        display: inline-block;
        width: 100%;
      }
    </style>
</head>
<body>
    <div class="demo">
        <p><span>昵称</span><input type="text" style = ' 100px'></p>
        <p><span>电子邮箱</span><input type="email" style = ' 100px;'></p>
    </div>
</body>
</html>
方法一
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
      span{
        width: 100px;
        display: inline-block;
        text-align-last: justify; /*不兼容Safari浏览*/
      }
    </style>
</head>
<body>
    <div class="demo">
        <p><span>昵称</span><input type="text" style = ' 100px'></p>
        <p><span>电子邮箱</span><input type="email" style = ' 100px;'></p>
    </div>
</body>
</html>
方法二
原文地址:https://www.cnblogs.com/Rooney10/p/13097663.html