4总

1.html中:


<!--index.html是网站首页对应html文件-->

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <!--设置网页标题-->
        <title>京东-欢迎登录</title>
        <!--设置网页图标-->
        <link rel="icon" type="image/ico" href="img/jd_logo.ico"/>
        <!--导入样式表-->
        <link rel="stylesheet" type="text/css" href="css/index.css"/>
    </head>
    
    <body>
        
        <!--===================顶部====================-->
        <div id="header">
            <!--====顶部的顶部====-->
            <div id="top">
                <div>
                    <img src="img/logo.png"/>
                    <img src="img/l-icon.png"/>
                </div>
                <a id="survey" target="_blank" href="https://surveys.jd.com/index.php?r=survey/index/sid/568245/lang/zh-Hans">登录页面,调查问卷</a>
            </div>
            <!--====顶部的底部====-->
            <div id="bottom">
                <p><img src="img/warning.png"/>&nbsp;&emsp;&emsp;依据《网络安全法》,为保障您的账户安全和正常使用,请尽快完成手机号验证! 新版<a target="_blank" href="https://about.jd.com/privacy/">《京东隐私政策》</a>已上线,将更有利于保护您的个人隐私。</p>
            </div>
            
        </div>
        <!--===================中间=====================-->
        <div id="content">
            <!--登录框-->
            <div id="login_page">
                <!--提示块-->
                <div id="div1">
                    <p><img src="img/xx.png"/>&emsp;&emsp;京东不会以任何理由要求您转账汇款,谨防诈骗。</p>
                </div>
                <!--按钮块-->
                <div id="div2">
                    <button id="btn1">扫码登录</button>|
                    <button id="btn2">账号登录</button>
                </div>
                <!--信息收集块-->
                <div id="div3">
                    <!--用户名-->
                    <div id="username">
                        <img src="img/pygame.png"/>
                        <input type="text" name="uersname" placeholder="邮箱/用户名/已验证手机" />
                    </div>
                    <!--密码-->
                    <div id="password">
                        <img src="img/password_icon.png"/>
                        <input type="password" name="password" placeholder="密码" />
                    </div>
                    <!--忘记密码-->
                    <a href="https://passport.jd.com/uc/links?tag=safe">忘记密码</a>
                    <!--登录-->
                    <button>登&emsp;录</button>
                </div>
                <!--注册和第三方登录-->
                <div id="div4">
                    <a id="a1" class="aa" href="">QQ</a>|
                    <a id="a2" class="aa" href="">微信</a>
                    <a id="a3" href="">立即注册</a>
                </div>
            </div>
            
        </div>
        <!--===================底部=====================-->
        <div id="footer">
            <div>
                <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>|
                <a href="">京东公益</a>|
                <a href="">English Site</a>
            </div>
            <p>Copyright © 2004-2018  京东JD.com 版权所有</p>
        </div>
        
    </body>
</html>

Css中:

/*==============(通用)================*/
*{
    /*消除默认的margin*/
    margin: 0;   
    /*消除默认padding*/
    padding: 0;
    /*让所有标签的子标签都相对自己定位*/
    position: relative;  
}


/*===============顶部=================*/
#header{
    height: 130px;
    /*background-color: seagreen;*/
}
/*====顶部的顶部====*/
#header #top{
    height: 80px;
    background-color: white;
}
#header #top div{
    width: 292px;
    height: 60px;
    
    /*相对定位-会让标签脱流*/
    position: absolute;
    left: 188px;
    
    /*垂直居中*/
    top: 50%;
    margin-top: -30px;
    line-height: 60px;  
    
}
#header #top #survey{
    /*布局*/
    position: absolute;
    right: 187px;
    bottom: 10px;
    
    /*设置字体*/
    color: rgb(180, 180, 180);
    font-size: 12px;
    /*去掉下划线*/
    text-decoration: none;
    
    /*添加背景图
     * background:url(图片地址)  repeat/no-repeat x y 背景颜色
     * x,y: x坐标和y坐标对应的值,除了可以设置数字值以外,和可以设置center,让背景图在x方向和y方向居中
     */
    padding-left: 23px;
    background:url(../img/q-icon.png) no-repeat 0 center white;
}
#header #top #survey:hover{
    color: red;
    text-decoration: underline;
}




/*====顶部的底部====*/
#header #bottom{
    height: 50px;
    background-color: rgb(255, 246, 236);
}
#header #bottom p{
    /*垂直方向居中*/
    height: 50px;
    line-height: 50px;
    
    /*水平方向居中*/
    text-align: center;
    
    /*设置字体*/
    color: rgb(180, 180, 180);
    font-size: 12px;
}
#header #bottom p img{
    /*垂直居中*/
    height: 25px;
    position: absolute;
    top: 50%;
    margin-top: -12px;
    line-height: 25px;
}
#header #bottom p a{
    color: rgb(30, 30, 30);
    /*去掉下划线*/
    text-decoration: none;
}
#header #bottom p a:hover{
    /*添加下划线*/
    text-decoration: underline;
}


/*===============中间=================*/
#content{
    height: 470px;
    /*<!--77,157,254-->*/
    background: url(../img/bg2.png) no-repeat 15% center rgb(77, 157, 254);
    
}
/*====登录界面=======*/
#content #login_page{
    width: 350px;
    height: 400px;
    background-color: white;
    
    /*定位*/
    position: absolute;
    right:200px;
    top: 15px;
}
/*--提示块--*/
#content #login_page #div1{
    height: 40px;
    background-color: rgb(255, 246,236);
}
#content #login_page #div1 img{
    height: 16px;
    position: absolute;
    top: 50%;
    margin-top: -8px;
    line-height: 16px;
}
#content #login_page #div1 p{
    /*垂直方向居中*/
    height: 40px;
    line-height: 40px;
    
    /*水平方向居中*/
    text-align: center;
    
    font-size: 12px;
    color: rgb(180, 180, 180);
}


/*--选中登录方式--*/
#content #login_page #div2{
    height: 60px;
    /*background-color: chartreuse;*/
    
    color: rgba(220, 220, 220, 0.6);
    /*设置字体粗细:取值范围是100-900*/
    font-weight: 100;
}
#content #login_page #div2 button{
    width: 48%;
    height: 100%;
    
    border: 0;
    
    font-size: 18px;
    color: rgb(60, 60, 60);
}
/*设置按钮成为焦点的状态*/
#content #login_page #div2 button:focus{
    color: red;
    /*按钮成为焦点默认的边框效果是outline*/
    outline: 0;
}

/*--信息收集块--*/
#content #login_page #div3{
    height: 250px;
    /*设置边框*/
    border-top: solid rgba(220, 220, 220, 0.6) 1px;
    border-bottom: solid rgba(220, 220, 220, 0.6) 1px;

}
#content #login_page #div3 div{
    width: 300px;
    height: 40px;
    
    margin-left: 25px;
    margin-top: 23px;
    
    border: solid rgb(170, 170, 170) 1px;
}
#content #login_page #div3 #username{
    margin-top: 35px;
}
/*图片*/
#content #login_page #div3 div img{
    width: 40px;
    height: 40px;
    float: left;
    
    border-right: solid rgb(170, 170, 170) 1px;
}
/*输入框*/
#content #login_page #div3 div input{
    height: 40px;
    width: 245px;
    
    border: 0;
    float: left;
    
    padding-left: 10px;
    
    font-size: 14px;
}
#content #login_page #div3 div input:focus{
    outline: 0;
}

/*忘记密码*/
#content #login_page #div3 a{
    position: absolute;
    right: 25px;
    margin-top: 20px;
    
    color: rgb(89, 89, 89);
    font-size: 12px;
    text-decoration: none;
}
#content #login_page #div3 a:hover{
    color: red;
    text-decoration: underline;
}

/*登录按钮*/
#content #login_page #div3 button{
    width: 300px;
    margin-left: 25px;
    height: 35px;
    
    position: absolute;
    bottom: 20px;
    
    background-color: rgb(219, 34, 46);
    border: none;
    
    color: white;
    font-size: 20px;
}


#content #login_page #div4{
    /*垂直方向居中*/
    height: 50px;
    line-height: 50px;
    
    font-size: 10px;
    color: rgba(220,220,220,0.8);
    
    
}
#content #login_page #div4 #a1{
    margin-left: 25px;
    margin-right: 15px;
    
    color: rgb(89,89,89);
    font-size: 12px;
    text-decoration: none;
    
    padding-left: 25px;
    background: url(../img/qq.png) no-repeat 0 center white;
    
}
#content #login_page #div4 #a2{
    margin-left: 5px;
    
    color: rgb(89,89,89);
    font-size: 12px;
    text-decoration: none;
    
    padding-left: 25px;
    background: url(../img/weixin.png) no-repeat 0 center white;
}

#content #login_page #div4 #a3{
    position: absolute;
    right: 25px;
    
    color: rgb(165,19,23);
    font-size: 12px;
    text-decoration: none;
    
    padding-left: 25px;
    background: url(../img/right.png) no-repeat 0 center rgba(0,0,0,0);
}

#content #login_page #div4 #a1:hover{
    color: red;
    text-decoration: underline;
}
#content #login_page #div4 #a2:hover{
    color: red;
    text-decoration: underline;
}
#content #login_page #div4 #a3:hover{
    text-decoration: underline;
}



/*===============底部=================*/
#footer{
    height: 105px;
}
#footer div{
    height: 50px;
    
    /*水平居中*/
    text-align: center;
    
    /*垂直居中*/
    line-height: 50px;
    
    font-size: 12px;
    color: rgb(89, 89, 89);
    
}

#footer div a{
    margin-left: 10px;
    margin-right: 10px;
    
    color: rgb(89, 89, 89);
    text-decoration: none;
}
#footer div a:hover{
    color: red;
    text-decoration: underline;
}
#footer p{
    color: rgb(89, 89, 89);
    font-size: 12px;
    
    /*水平居中*/
    text-align: center;
}
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 156,757评论 4 359
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 66,478评论 1 289
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 106,540评论 0 237
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,593评论 0 203
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 51,903评论 3 285
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,329评论 1 210
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,659评论 2 309
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,383评论 0 195
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,055评论 1 238
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,337评论 2 241
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 31,864评论 1 256
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,227评论 2 251
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 32,820评论 3 231
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 25,999评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,750评论 0 192
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,365评论 2 269
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,260评论 2 258

推荐阅读更多精彩内容

  • 第一部分 HTML&CSS整理答案 1. 什么是HTML5? 答:HTML5是最新的HTML标准。 注意:讲述HT...
    kismetajun阅读 27,088评论 1 45
  • 1.认识字符串,'圣诞节开发ya123', "abc%u23", '\n\t\'"', '',""2.python...
    大黄蜂人工智能阅读 165评论 0 0
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 13,625评论 1 92
  • 在这个上了床都没有结果的时代,明星出轨也是频繁的存在。文章出轨了、林丹出轨了、白百合出轨了......而那些处女的...
    淡香流怡阅读 946评论 11 7
  • 哪些情况下可获补偿金 一、用人单位不续约 用人单位与你所签合同到期,接下来双方自然就会考虑要不要继续签约: 如果用...
    戰敭阅读 258评论 0 0