【HTML】一個簡單的登陸頁面
阿新 • • 發佈:2018-10-31
HTML頁面程式碼如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="index_style.css"> <title>全屏背景</title> </head> <body> <div id="div_login"> <div id="div_title"><h1>使用者登陸</h1></div> <div id="midden"> <p><input class="inputinfo" type="text" name="UserName" placeholder="請輸入使用者名稱"></p> <p><input class="inputinfo" type="password" name="PassWord" placeholder="請輸入密碼"></p> <input type="submit" class="submitbutton" value="登陸"> <div id="info"> <h3>注意事項</h3> <p>1.這裡是注意事項這裡是注意事項這裡是注意事項</p> <p>2.這裡是注意事項這裡是注意事項這裡是注意事項</p> <p>3.這裡是注意事項這裡是注意事項這裡是注意事項</p> <p>4.這裡是注意事項這裡是注意事項這裡是注意事項</p> </div> </div> </div> </body> </html>
CSS頁面程式碼如下:
html,body{ width:100%; height:100% } body{ font-family: "華文細黑"; background:url("https://ss3.bdstatic.com/lPoZeXSm1A5BphGlnYG/skin/2.jpg?2") no-repeat; background-size: 100%; } #div_login{ width:500px; height: 500px; background-color:rgba(58,58,58,0.5); float:right; margin:50px 50px; padding: 0px; } #div_title{ width: 500px; height: 60px; background-color:rgba(0,0,0,0.5); text-align: center; line-height: 60px; color:blanchedalmond; } *{ margin:0px; padding: 0px; } #midden{ width:500px; height: 440px; background-color: rgba(77, 75, 75, 0.5); } .inputinfo{ width: 480px; height:30px; margin:10px 10px 10px 10px; } .submitbutton{ width: 480px; height:40px; margin:10px 10px 10px 10px; background-color: rgba(89, 89, 89, 0.5) } #info{ width:200px; text-align: center; margin: 0 auto; }