欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

前端form表单中文本对齐以及文本输入框对齐

程序员文章站 2022-05-29 17:49:35
...

自己记录,方便日后查看

<!-- exp_15_1.html 实验15-1 -->
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
<html>
    <head>
        <title> 表单处理事件 </title>
        <style type="text/css">
            fieldset
            {
                margin:30px auto;
                width:300px;
                height:300px;
                padding:20px auto;
                color:blue;
                text-align:center;
            }
          
			/*label部分CSS才是重点*/
			label
			{
				display: inline-block;
				width: 60px;
				text-align: justify;
				text-align-last: justify;
				margin-right: 10px;
				}
				
				
        </style>
        
    </head>
    <body>
        <form name="loginform" method="post" action="loginindex.html" onsubmit="return checklogin()">
            <fieldset>
                <legend>用户登录</legend>
                <br><br>
                <label>用户名</label>
                <input type="text" name="" id="myname" ><br><br>
                <label>密&nbsp;&nbsp;码</label>
                <input type="password" name="" id="mypwd" ><br><br><br>
                <input type="submit" value="提交"><input type="reset">
            </fieldset>
        </form>
    </body>
</html>

效果图:
前端form表单中文本对齐以及文本输入框对齐

相关标签: 前端