怎么才能实现我的这个登录界面实现在屏幕中央

向往编程 2019-06-25 08:50:49
<!DOCTYPE html> <html long="en"> <head> <meta charset="UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>login</title> <style type="text/css"> body { width: device-width; height: auto; background-image: url(images/background_boy.jpg); background-repeat: no-repeat; background-size: 100%; } </style> <script> function checkLogon() { var name = document.getElementById("username").value; var pass = document.getElementById("password").value; if((name==null || name=="") || (pass==null || pass=="")) { alert("The user name or password cannot be empty"); } else{ if(name=="Alex" && pass=="12356") { alert("creat successfull"); window.location.href="index.html"; } else{ alert("The user name or password error"); } } } </script> </head> <body> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="25">Username</td> <td><input name="textfield" type="text" size="14" id="username"></td> </tr> <tr> <td height="25">password</td> <td><input name="textfield2" type="text" size="14" id="password"></td> </tr> <tr> <td height="25" colspan="2"><div align="center"> <input type="submit" name="Submit" value="login" onClick="checkLogon()"> </div></td> </tr> </table> </body> </html>
...全文
113 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
向往编程 2019-06-25
  • 打赏
  • 举报
回复
引用 1 楼 usecf的回复:
<body> <div align="center"> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="25">Username</td> <td><input name="textfield" type="text" size="14" id="username"></td> </tr> <tr> <td height="25">password</td> <td><input name="textfield2" type="text" size="14" id="password"></td> </tr> <tr> <td height="25" colspan="2"><div align="center"> <input type="submit" name="Submit" value="login" onClick="checkLogon()"> </div></td> </tr> </table> </div> </body>
谢谢一楼回复 很感谢
usecf 2019-06-25
  • 打赏
  • 举报
回复
<body> <div align="center"> <table width="200" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="25">Username</td> <td><input name="textfield" type="text" size="14" id="username"></td> </tr> <tr> <td height="25">password</td> <td><input name="textfield2" type="text" size="14" id="password"></td> </tr> <tr> <td height="25" colspan="2"><div align="center"> <input type="submit" name="Submit" value="login" onClick="checkLogon()"> </div></td> </tr> </table> </div> </body>

61,115

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧