html - Why is my table doing this? -


i've done try work out here's problem:

it happened after wrapping table in form, anyways, if possible need centred unless centring correct. please tell me did wrong , should next time!

html:

<!doctype html> <html lang="en"> <head>     <link rel="stylesheet" type="text/css" href="styles.css">     <meta charset="utf-8">     <title>game</title> </head> <body bgcolor="#336699">   <div id="login">     <form id="login" action="login.php" method="post">     <table>         <tr><td>login</td></tr>         <tr><td>username: <input type="text"></td></tr>         <tr><td>password: <input type="password"></td></tr>         <tr><td><input type="submit"></td></tr>        </table>     </form> </div> </body> </html> 

css:

#header{     text-align: center; }  #login{     font-family: "arial", "serif";     margin-right: auto;     margin-left: auto;     width: 15%;     text-align: center;     border: solid 1px;  }  #table,th,td{     border: solid 1px; } 

its because of login id, have given 15% width. increase 50 or 60% , work.

#login{     font-family: "arial", "serif";     margin-right: auto;     margin-left: auto;     width: 15%;     text-align: center;     border: solid 1px;  } 

working example:

http://jsfiddle.net/vcz72sxy/1/

edit

i have changed code previous poster, added align value within table center it.

http://jsfiddle.net/kc3gh83h/1/


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -