div中有两个input控件,怎样让这两个控件在div居中显示

解决方案 »

  1.   

    你给两个input放到table里,在设置algin比较好,总之方法多着呢
      

  2.   

    <div style="margin:0 auto" align="center"><input type="text"/><input type="text"/></div>
    <div style="margin-left:auto;margin-right:auto" align="center"><input type="text"/><input type="text"/></div>
      

  3.   

    如果不需要换行,请自己去掉<br/><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>测试文档</title>
    </head>
    <body>
    <div style="margin:0 auto" align="center">
        <p>
         Text1:<input type="text" />
            <br />
            Text2:<input type="text" /> 
        </p>
    </div> 
    </body>
    </html>