HTML+CSS文本兩端對齊,文字自動平均分布


<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>文本兩端對齊模板-案例</title>
    <style type="text/css">
        /*文本兩端對齊*/
        .text-justify{float:left;text-align:justify;text-justify:inter-word;text-justify:inter-ideograph;width:80px;height:20px;}
        .span-justify{display:inline-block;width:100%;}
    </style>
</head>
<body>
    <form>
        <div>
        <div>
        <label class="text-justify">用 戶 名:<span class="span-justify"></span></label><input type="text" name="username" placeholder="請輸入用戶名" />
        </div>
        <div>
        <label class="text-justify">密 碼:<span class="span-justify"></span></label><input type="password" name="password" placeholder="請輸入用戶密碼" />
        </div>
    </div>
    </form>
    
</body>
</html>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM