使用HTML5搭建京东登录界面(二)

在我们html文件中,引入了2个css文件,分别为reset.css和login.css。下面我们就来看一下这2个css文件是如何实现布局的。

先来看一下reset.css,这里是对于整个html文件共同的元素需要统一设置的样式,

代码如下:

login.css是针对性的设置各个布局的样式

代码如下:

/*header*/

*{

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box;}

header{

width:100%;

height: 80px;

}

header .header-content{

box-sizing: border-box;

width: 990px;

height: 80px;

margin: 0 auto;

/*background-color: red;*/

}

header .header-content .logo{

float: left;

width: 160px;

height: 60px;

background: url("../image/icon.png") no-repeat 0 15px;

}

header .header-content span{

float: left;

font-size: 24px;

padding-left: 30px;

margin-top: 20px;

}

header .header-content .login{

float: right;

font-size: 12px;

margin-top: 55px;

padding-bottom: 5px;

font-family: Arial,Verdana,"\5b8b\4f53";

}

header .header-content .login i{

display: inline-block;

width: 18px;

height: 16px;

margin: 0 5px;

background: url("../image/msg-icon.png") no-repeat ;

}

header .header-content .login a{

color: #999;

position: relative;

top: -5px;

}

header .header-content .login a:hover {

color: #E4393C;

text-decoration: underline;

}

main{

width:100%;

height: 475px;

background-color: #E8C99A;

position: relative;

}

main section{

width: 990px;

height:100%;

margin:  0 auto;

background: url("../image/loginBg.jpg")no-repeat 0 0 ;

}

main section .login-content{

width: 346px;

height: 346px;

padding: 20px;

float: right;

top: 40px;  ;

background: #fff;

position: relative;

color: #666;

}

main section .login-content-top{

width:100%;

height: 55px;

border-bottom: 1px solid #f4f4f4;

position: absolute;

top: 0;

left:0;

}

main section .login-content-top a:hover,main section .login-content-top a:nth-child(2) {

font-weight: bold;

color: #e4393c;

}

main section .login-content-top a{

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box;

float: left;

width: 50%;

height: 100%;

padding: 0 20px;

text-align: center;

line-height: 55px;

color: #666;

font-size: 18px;

}

main section .login-content-notice{

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box;

width: 100%;

height: 23px;

position: relative;

background: #fef4e5;

color: #666;

margin: 40px auto 5px;

padding-left: 40px;

border: 1px solid #f6c090;

font-size: 12px;

line-height: 23px;

}

main section .login-content-notice i{

display: inline-block;

width: 16px;

height: 17px;

position: absolute;

left: 10px;

top: 3px;

background: url("../image/pwd-icons.png")no-repeat  -104px -24px;

}

main section form{

width: 100%;

}

main section form .form-item{

border: 1px solid #bdbdbd;

height: 38px;

width: 100%;

margin-bottom: 20px;

position: relative;

}

main section form .form-item label{

position: absolute;

top: 0;

left: 0px;

width: 38px;

height: 36px;

border-right: 1px solid #bdbdbd;

}

main section form .form-item input{

height: 100%;

width:100%;

padding-left: 45px;

color: #666;

border: none;

}

main section form .form-item:nth-child(1) label{

background: url("../image/pwd-icons.png") no-repeat ;

}

main section form .form-item:nth-child(2) label{

background: url("../image/pwd-icons.png") no-repeat -48px 0;

}

main section form .form-check{

font-size: 12px;

}

main section form .form-check label{

margin-left: 5px;

vertical-align: top;

}

main section form .form-check a{

float: right;

color: #666;

}

main section form .form-check a:hover{

color: #E4393C;

text-decoration: underline;

}

main section form input[type = submit]{

width:100%;

height: 31px;

background: #e4393c;

color: #ffffff;

font-size: 18px;

word-spacing: 1em;

border: 1px solid #e85356;

margin-top: 15px;

}

main section .login-content-bottom{

width:100%;

position: absolute;

bottom:0;

left: 0;

padding: 0 18px;

line-height: 50px;

border-top: 1px solid #f4f4f4;

background-color: #fcfcfc;

}

main section .login-content-bottom a{

font-size: 12px;

}

main section .login-content-bottom span{

padding-left: 1px;

margin: 0 5px;

font-size: 10px;

background-color: #999;

}

main section .login-content-bottom a i{

width: 19px;

height: 18px;

display: inline-block;

position: relative;

top: 5px;

}

main section .login-content-bottom a:nth-child(1) i{

margin-right: 5px;

background: url("../image/QQ-weixin.png") no-repeat;

}

main section .login-content-bottom a:nth-child(3) i{

margin-right: 5px;

background: url("../image/QQ-weixin.png") no-repeat -20px 0;

}

main section .login-content-bottom a:nth-child(6){

float: right;

}

main section .login-content-bottom a:nth-child(6) i{

margin-right: 5px;

background: url("../image/pwd-icons.png")-104px -75px no-repeat;;

}

main section .login-content-bottom a:hover {

color: #e4393c;

text-decoration: underline;

}

/*footer*/

footer{

font-size: 12px;

text-align: center;

border-top: solid 1px #e6e6e6;

color: #999;

padding-bottom: 30px;

}

footer p a{

font-size: 12px;

text-align: center;

color: #999;

}

footer p:nth-child(1){

padding-top: 30px;

padding-bottom: 15px;

}

footer p span{

padding-left: 1px;

margin: 0 10px;

font-size: 10px;

background-color: #999;

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 200,783评论 5 472
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 84,396评论 2 377
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 147,834评论 0 333
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,036评论 1 272
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,035评论 5 362
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,242评论 1 278
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,727评论 3 393
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,376评论 0 255
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,508评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,415评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,463评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,140评论 3 316
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,734评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,809评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,028评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,521评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,119评论 2 341

推荐阅读更多精彩内容