<input >標籤內的type分別爲password和text時其默認長度和寬度不一致,而在做登陸框時往往需要將它們的長度和寬度設置一致。如下的方法可以通過css控制使其一致:
<html>
<head></head>
<body>
調整前:</br>
用戶名:<input type="text" id="tex"></br>
密 碼:<input type="password" id="pass"></br></br>
調整後:</br>
用戶名:<input type="text" style="width:180px;height:20px;" id="tex"></br>
密 碼:<input type="password" style="width:180px;height:20px;" id="pass">
</body>
</html>
<head></head>
<body>
調整前:</br>
用戶名:<input type="text" id="tex"></br>
密 碼:<input type="password" id="pass"></br></br>
調整後:</br>
用戶名:<input type="text" style="width:180px;height:20px;" id="tex"></br>
密 碼:<input type="password" style="width:180px;height:20px;" id="pass">
</body>
</html>
以下爲頁面截圖:
此文內容小,記之,以提醒我時常對學過的點滴進行總結。