• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Html制作简单而漂亮的登录页面

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

先来看看样子。

html源码:

XML/HTML Code复制内容到剪贴板
  1. <!DOCTYPE html>  
  2. <html lang="en">  
  3. <head>  
  4.     <meta charset="UTF-8">  
  5.     <title>Login</title>  
  6.     <link rel="stylesheet" type="text/css" href="Login.css"/>  
  7. </head>  
  8. <body>  
  9.     <div id="login">  
  10.         <h1>Login</h1>  
  11.         <form method="post">  
  12.             <input type="text" required="required" placeholder="用户名" name="u"></input>  
  13.             <input type="password" required="required" placeholder="密码" name="p"></input>  
  14.             <button class="but" type="submit">登录</button>  
  15.         </form>  
  16.     </div>  
  17. </body>  
  18. </html>  

css代码:

CSS Code复制内容到剪贴板
  1. html{   
  2.     width: 100%;   
  3.     height: 100%;   
  4.     overflowhidden;   
  5.     font-stylesans-serif;   
  6. }   
  7. body{   
  8.     width: 100%;   
  9.     height: 100%;   
  10.     font-family'Open Sans',sans-serif;   
  11.     margin: 0;   
  12.     background-color#4A374A;   
  13. }   
  14. #login{   
  15.     positionabsolute;   
  16.     top: 50%;   
  17.     left:50%;   
  18.     margin: -150px 0 0 -150px;   
  19.     width300px;   
  20.     height300px;   
  21. }   
  22. #login h1{   
  23.     color#fff;   
  24.     text-shadow:0 0 10px;   
  25.     letter-spacing1px;   
  26.     text-aligncenter;   
  27. }   
  28. h1{   
  29.     font-size: 2em;   
  30.     margin: 0.67em 0;   
  31. }   
  32. input{   
  33.     width278px;   
  34.     height18px;   
  35.     margin-bottom10px;   
  36.     outlinenone;   
  37.     padding10px;   
  38.     font-size13px;   
  39.     color#fff;   
  40.     text-shadow:1px 1px 1px;   
  41.     border-top1px solid #312E3D;   
  42.     border-left1px solid #312E3D;   
  43.     border-right1px solid #312E3D;   
  44.     border-bottom1px solid #56536A;   
  45.     border-radius: 4px;   
  46.     background-color#2D2D3F;   
  47. }   
  48. .but{   
  49.     width300px;   
  50.     min-height20px;   
  51.     displayblock;   
  52.     background-color#4a77d4;   
  53.     border1px solid #3762bc;   
  54.     color#fff;   
  55.     padding9px 14px;   
  56.     font-size15px;   
  57.     line-heightnormal;   
  58.     border-radius: 5px;   
  59.     margin: 0;   
  60. }  

总结:

复制代码
代码如下:
<input type="text" required="required" **placeholder="用户名"** name="u"></input>
<input type="password" required="required" **placeholder="密码"** name="p"></input>

placeholder="用户名"的作用:占位符

以上就是本文的全部内容,希望对大家的学习有所帮助。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
关于表格table嵌套,边框合并问题的解决方法发布时间:2022-06-21
下一篇:
深入理解html表单输入监听发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap