问答详情
源自:12-4 我还要站个大位置 - 内联块状元素

登录框居中,求大神帮忙补全代码,让整体居中.

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>文本输入框、密码输入框</title>

<style type="text/css">div{text-align:center;}

</style>

</head>

<body>

<form  method="post" action="save.php">

账户:

    <input  type="text"  name="myName" />

    <br>

    密码:

<input  type="password"  name="pass" />

</form>

</body>

</html>


提问者:大大叔叔 2018-12-19 17:23

个回答

  • 慕粉2237001
    2021-07-12 11:41:13

    <!DOCTYPE HTML>


    <html>


    <head>


    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">


    <title>文本输入框、密码输入框</title>


    <style type="text/css">

    div

    {

        text-align:center;

        

    }


    </style>


    </head>


    <body>

    <div>

    <form  method="post" action="save.php">


    账户:


        <input  type="text"  name="myName" />


        <br>


        密码:


    <input  type="password"  name="pass" />


    </form>

    </div>

    </body>


    </html>


  • 慕前端500899
    2019-01-12 10:43:21

    采用嵌入式, body{text-align:center;}

  • qq_慕雪8192717
    2018-12-19 18:40:27

    <!DOCTYPE HTML>

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <title>文本输入框、密码输入框</title>

    <style type="text/css">div{text-align:center;}

    .a{text-align: center;}

    </style>

    </head>

    <body>

    <form  method="post" action="save.php">

    <div class="a">账户:

        <input  type="text"  name="myName" />

        <br>

        密码:

    <input  type="password"  name="pass" />

    </div>

    </form>

    </body>

    </html>