web前端--仿制某電商登錄頁(yè)面

通過(guò)html和css仿制靜態(tài)頁(yè)面:采用盒子模型的布局模式
涉及到的標(biāo)簽有:a p div form input img
涉及到的CSS屬性組:字體、背景、顏色、外邊距、內(nèi)邊距、高寬、定位、浮動(dòng)、顯示等;
盒子模式:主要借助position、float、display實(shí)現(xiàn),控制好content、padding、border、outline、margin
CSS端代碼如下:

/* ---------------通用------------------ */
*{
    margin: 0;  /* 消除默認(rèn)的margin */
    padding: 0;  /* 消除默認(rèn)的padding */
    position: relative; /* 所有標(biāo)簽的子標(biāo)簽都相對(duì)自己定位*/
} 


/* ------------------頂部---------------- */
#header{
    height: 130px;
    /* background-color: limegreen; */
}
#header #top{
    height: 100px;
    
}
#header #top div{
    width:292px;
    position: absolute;
    left:188px;
    top:50%; 
    margin-top:-30px; 
    line-height: 60px; 
}
#header #top #survey {
    
    position: absolute;
    right:188px;
    bottom:10px;
    color: rgb(140,146,152);
    font-size:12px;
    text-decoration:none ;
    padding-left: 22px;
    /* 添加背景圖 
      background:url(地址)、是否平鋪、x y 背景色
      x和y可以設(shè)置center,讓背景圖居中
    */
    background:url(../img/q-icon.png) no-repeat 0 center white;
    
}
#header #top #survey:hover{
    color: red;
    text-decoration: underline;
}

#header #bottom{
    height: 30px;
    background-color: lightgoldenrodyellow; 
    text-align: center;
    
}
#header #bottom img{
    display: inline;
    vertical-align: middle;
}
#header #bottom p{ 
    height: 30px;
    line-height: 30px;
    text-align: center;
    color: rgb(140,146,152);
    font-size: 15px;
    display: inline;
    vertical-align: middle;
    /* padding-left: 20px; */
    /* 添加背景圖 */
    /* background: url(../img/xx.png) no-repeat 20% center white; */
}
#header #bottom p a{
    color: black;
    text-decoration: none;
}
#header #bottom p a:hover{
    text-decoration: underline;
}
/* ------------------中間--------------- */
#middle{
    height: 470px;
    background: url(../img/bg2.png) no-repeat 16% center rgb(77,157,254);
}

#middle #login_page{
    width:350px;
    height: 400px;
    background-color: white; 
    position: absolute;
    top:35px;
    right: 10%;
}
/* 登錄模塊-提示模塊 */
#middle #login_page #div1{
    
    
    height: 40px;
    background-color: rgb(255,246,236);
    text-align: center;
    line-height: 40px;
}
#middle #login_page #div1 img{
    display: inline;
    vertical-align: middle;
}
#middle #login_page #div1 p{
    display: inline;
    vertical-align: middle;
    font-size: 12px;
}
/* 登錄模塊-選擇模塊 */
#middle #login_page #div2{
    
    height: 60px;
    /* background-color: cadetblue; */
}
#middle #login_page #div2 button{
    width:48%;
    height: 100%;
    border-style: none;
    font-size: 20px;
    font-weight: 100;
    /* font-family: "黑體"; */
    color: rgb(60,60,60);
    background-color: white;
}
#middle #login_page #div2 button:focus{
    color: red;
    outline: 0;
}
#middle #login_page #div3{
    
    height: 250px;
    /* background-color:limegreen; */
    border-top:1px solid rgba(220,220,220,0.6);
    border-bottom:1px solid rgba(220,220,220,0.6);
    
}
#middle #login_page #div3 div{
    width: 300px;
    margin-top:20px;
    margin-left:25px;
    margin-top:23px;
    height: 40px;
    border: 1px solid rgba(120,120,120,0.6);
}
#middle #login_page #div3 #usrname{
    margin-top: 35px;
}
#middle #login_page #div3 div img{
    width: 40px;
    height: 40px;
    float:left
}
#middle #login_page #div3 div input{
    width: 250px;
    height: 40px;
    border: 0;
    float: left;
    border-left: 1px solid rgba(120,120,120,0.6);
    padding-left: 5px;
}
#middle #login_page #div3 a{
    position: absolute;
    right: 25px;
    margin-top: 20px;
    color: rgb(150,150,150);
    font-size: 12px;
    text-decoration: none;
    
}
#middle #login_page #div3 a:hover{
    color: red;
    text-decoration:underline;
}
#middle #login_page #div3 button{
    width: 300px;
    height: 30px;
    margin-left: 25px;
    position: absolute;
    bottom:20px;
    border:0;
    background-color: rgb(219,34,36);
    color: white;
    font-size:20px;
    cursor:pointer;
    
}

#middle #login_page #div4{
    
    height: 50px;
    /* background-color: gold; */
    line-height: 50px;
    margin: 0 25px;
    overflow: hidden;
    
}
#middle #login_page #div4 a{
    text-decoration: none;
    font-size: 15px;
}

#middle #login_page #div4 #a1{
    /* margin-left: 25px; */
    padding-left: 25px;
    margin-right: 25px;
    background: url(../img/qq.png) no-repeat 0 center white;
    
}
#middle #login_page #div4 #a2{
    /* margin-left: 25px; */
    padding-left: 25px;
    background: url(../img/weixin.png) no-repeat 0 center white;
    
}
#middle #login_page #div4 #a3{
    position: absolute;
    right: 0;
    padding-left: 25px;
    background: url(../img/right.png) no-repeat 0 center white;
        
}
/* -----------------底部----------------- */
#footer{
    height: 100px;
    text-align: center;
    line-height: 50px;
    font-size: 12px;
    color: rgb(125,125,125);
}
#footer div{
    height: 100px;
    
}
#footer div a{
    text-decoration: none;
    margin: 0 20px; 
    
}
#footer p{
    height: 20px;
    line-height: 20px;
    font-size: 12px;
    
}
#footer a:hover{
    text-decoration: underline;
    color: red;
}

html端代碼如下:

<!DOCTYPE html>
<html>
  <head>
      <meta charset="utf-8" />
      <title>京東-歡迎登錄</title>
      <link rel="icon" type="image/ico" href="img/aaa.ico"/>
      <link rel="stylesheet" type="text/css" href="css/index.css"/>
  </head>
  <body>
      <div id="header">
          <div id="top">
              <div id="">
                  <img src="img/logo.png" >
                  <img src="img/l-icon.png" >
              </div>
              <a id="survey" target="_blank" >登錄界面,調(diào)查問(wèn)卷</a>
          </div>
          <div id="bottom">
              <img src="img/xx.png" >
              <p>依據(jù)《網(wǎng)絡(luò)安全法》,為保障您的賬戶安全和正常使用,請(qǐng)盡快完成手機(jī)號(hào)驗(yàn)證! 新版<a target="_blank" >《京東隱私政策》</a>已上線,將更有利于保護(hù)您的個(gè)人隱私。</p>
          </div>
      </div>
      <div id="middle">
          <div id="login_page">
              <div id="div1">
                  <img src="img/xx.png" >
                  <p>京東不會(huì)以任何理由要求您轉(zhuǎn)賬匯款,謹(jǐn)防詐騙。</p>
              </div>
              <div id="div2"> 
              <button id="btn1" type="button">掃碼登錄</button>|
              <button id="btn2" type="button">賬號(hào)登錄</button>
              </div>
              <div id="div3"> 
                  <div id="usrname">
                      <img src="img/pygame.png" >
                      <input type="text" name="usrname" id="" value="" placeholder="郵箱/用戶名/已驗(yàn)證手機(jī)"/>
                  </div>
                  <div id="password">
                      <img src="img/password_icon.png" >
                      <input type="password" name="password" id="" value="" placeholder="密碼"/>
                  </div>
                  <a >忘記密碼</a>
                  <button type="button">登&emsp;錄</button>
              </div>
              <div id="div4"> 
                   <a id="a1" href="">QQ</a>|
                   <a id="a2" href="">微信</a>
                   <a id="a3" href="">立即注冊(cè)</a>
              </div>
          </div>
      </div>
          
      <div id="footer">
          <div id="">
              <a  target="_blank">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a>|
              <a href="">人才招聘</a> 
          </div>
          <p>Copyright ? 2004-2018  京東JD.com 版權(quán)所有</p>
      </div>
  </body>
</html>



效果如下:


jingdong.png
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容