abstrak:一、截圖二、html部分<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial
一、截圖
二、html部分
<!DOCTYPE html> <html> <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"> <title>小米商城--登錄</title> <link rel="shortcut icon" href="static/img/footlogo.png" type="image/x-icon"> <link rel="stylesheet" href="static/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="static/layui/css/layui.css"> <link rel="stylesheet" href="static/css/login.css"> </head> <body> <div class="header"> <a href="index.html"><img src="static/img/5.png" alt=""></a> </div> <div class="contents"> <div class="content"> <div class="content-main"> <div class="content-top"> <p style="color:#ff6700;" id="tab-0" onclick="changeTab('0','login-',1)">賬號登錄</p> <span>|</span> <p id="tab-1" onclick="changeTab('1','login-',1)">掃碼登錄</p> </div> <div class="content-form" id="login-0"> <form action=""> <input type="text" name="username" placeholder="請輸入用戶名"> <input type="password" name="password" placeholder="請輸入密碼"> <button>登 錄</button> </form> <div class="content-div"> <a href="" style="color:#ff6700;">手機短信登錄/注冊</a> <span><a href="">立即注冊</a> | <a href="">忘記密碼?</a></span> </div> <div class="content-bottom"> <div class="content-bottom-t">其他方式登錄</div> <div class="content-bottom-pic"> <a href=""><span class="fa fa-qq span1"></span></a> <a href=""><span class="fa fa-weibo span2"></span></a> <a href=""><span class="fa fa-twitter-square span3"></span></a> <a href=""><span class="fa fa-weixin span4"></span></a> </div> </div> </div> <div class="content-login" id="login-1"> <img src="static/img/xz.png" alt=""> <p>使用 <span style="color:#ff6700;">小米商城APP</span> 掃一掃</p> <p>小米手機可打開「設置」>「小米帳號」掃碼登錄</p> </div> </div> </div> </div> <p class="bottom" style="margin-top:60px;">簡體<span>|</span>繁體<span>|</span>English<span>|</span>常見問題<span>|</span>隱私政策</p> <p class="bottom">小米公司版權所有-京ICP備10046444-<img src="static/img/ghs.png"> 京公網(wǎng)安備11010802020134號-京ICP證110507號</p> <script type="text/javascript"> function changeTab(divId,divName,count){ for(var i=0;i<=count;i++){ document.getElementById(divName+i).style.display='none'; } document.getElementById(divName+divId).style.display='block'; if(divId==0){ document.getElementById('tab-0').style.color='#ff6700'; document.getElementById('tab-1').style.color='#757575'; } if(divId==1){ document.getElementById('tab-0').style.color='#757575'; document.getElementById('tab-1').style.color='#ff6700'; } } </script> </body> </html>
三、css部分
*{margin:0;padding:0;font-family: "微軟雅黑";} a{text-decoration: none;cursor: pointer;} li{list-style: none;} .header{width:1226px;height:100px;margin:0 auto;line-height:100px;} .contents{width:100%;height:580px;background: url(../img/login.png) no-repeat center top;} .content{width:1226px;height:580px;margin:0px auto;} .content-main{float: right;width:410px;height:520px;background: #fff;margin:30px 50px;} .content-top{width:330px;height:50px;margin:25px auto;} .content-top p{width:150px;height:50px;float:left;font-size:23px;color:#757575;text-align: center;line-height:50px;} .content-top span{float:left;font-size:30px;color:#e0e0e0;line-height:50px;font-weight: 300;} input{border:none;display: block;width:328px;height: 28px;border:1px solid #e0e0e0;padding:11px;margin:15px auto;} button{border:none;display: block;width:350px;height:50px;background: #ff6700;margin:15px auto 0;color: #fff;font-size:16px;} .content-form .content-div{width:350px;height:40px;margin:0 auto;line-height: 40px;font-weight: 400;} .content-form .content-div a{color:#ccc;} .content-form .content-div span{float: right;color:#ccc;} .content-form .content-div span a:hover{color:#ff6700;} .content-bottom{width:350px;height:50px;margin:100px auto;border-top:1px solid #e0e0e0;position: relative;} .content-bottom .content-bottom-t{position: absolute;top:-16px;left:125px;width:100px;height:30px;line-height:30px;background: #fff;text-align: center;color:#757575;} .content-bottom .content-bottom-pic{width:350px;height:50px;margin:25px auto;text-align: center;} .content-bottom .content-bottom-pic a{font-size:18px;color:#fff;} .span1,.span2,.span3,.span4{width:32px;height:32px;background:#6D6E6A;line-height:32px;text-align: center;border-radius: 50%;margin:0 20px;} .content-bottom .content-bottom-pic .span1:hover{background:#FFAC13;} .content-bottom .content-bottom-pic .span2:hover{background:#83C44E;} .content-bottom .content-bottom-pic .span3:hover{background:#E53935;} .content-bottom .content-bottom-pic .span4:hover{background:#2196F3;} .content-login{text-align:center;display:none;} .content-login img{width:190px;height:180px;margin:60px auto 15px;} .content-login p{color:#757575;} .bottom{width:1226px;height:38px;margin:0 auto;text-align: center;color:#757575;line-height: 38px;} span{font-size:13px;margin:0 10px;}
Guru membetulkan:天蓬老師Masa pembetulan:2019-04-29 09:16:34
Rumusan guru:你的css代碼的風格, 并不是行業(yè)的規(guī)范, 多個樣式規(guī)則 , 還是建議一行一個, 不要全部水平排列....
每行堅持 只寫一個樣式, 這樣即利于注釋, 也利于調試, 你說呢?