[HTML+CSS] 仿京东首页项目实战

/*清除元素默认的内外边距 */

  • {

margin: 0;

padding: 0

}

/让所有斜体 不倾斜/

em,

i {

font-style: normal;

}

/去掉列表前面的小点/

li {

list-style: none;

}

/图片没有边框 去掉图片底侧的空白缝隙/

img {

border: 0; /ie6/

vertical-align: middle;

}

/让button 按钮 变成小手/

button {

cursor: pointer;

}

/取消链接的下划线/

a {

color: #666;

text-decoration: none;

}

a:hover {

color: #e33333;

}

button,

input {

font-family: ‘Microsoft YaHei’, ‘Heiti SC’, tahoma, arial, ‘Hiragino Sans GB’, \5B8B\4F53, sans-serif;

outline: none;

}

body {

background-color: #fff;

font: 12px/1.5 ‘Microsoft YaHei’, ‘Heiti SC’, tahoma, arial, ‘Hiragino Sans GB’, \5B8B\4F53, sans-serif;

color: #666

}

.hide,

.none {

display: none;

}

/清除浮动/

.clearfix:after {

visibility: hidden;

clear: both;

display: block;

content: “.”;

height: 0

}

.clearfix {

*zoom: 1

}

common.css


/公共样式/

.fl {

float: left;

}

.fr {

float: right;

}

@font-face {

font-family: ‘icomoon’;

src: url(‘…/fonts/icomoon.eot?7kkyc2’);

src: url(‘…/fonts/icomoon.eot?7kkyc2#iefix’) format(‘embedded-opentype’),

url(‘…/fonts/icomoon.ttf?7kkyc2’) format(‘truetype’),

url(‘…/fonts/icomoon.woff?7kkyc2’) format(‘woff’),

url(‘…/fonts/icomoon.svg?7kkyc2#icomoon’) format(‘svg’);

font-weight: normal;

font-style: normal;

}

.fr .icomoon {

font-family: ‘icomoon’;

font-size: 14px;

}

/版心/

.w {

width: 1200px;

margin: 0 auto;

}

/顶部快捷导航/

.shortcut {

height: 31px;

background-color: #f1f1f1;

line-height: 31px;

}

.shortcut li {

float: left;

}

.style-red {

color: red;

}

/小竖线/

.spacer {

width: 1px;

height: 12px;

background-color: #666;

margin: 9px 12px;

}

.header {

position: relative;

height: 105px;

}

.logo {

position: absolute;

top: 25px;

left: 0;

width: 175px;

height: 56px;

}

.logo a {

display: block;

width: 175px;

height: 56px;

background: url(…/images/logo.png) no-repeat;

font-size: 0;

}

.search {

position: absolute;

top: 25px;

left: 348px;

}

.text {

float: left;

width: 445px;

height: 32px;

border: 2px solid #b1191a;

color: #999;

padding-left: 10px;

}

.btn {

float: right;

width: 82px;

height: 36px;

background-color: #b1191a;

border: 0;

font-size: 16px;

color: #fff;

}

.hotwords {

position: absolute;

top: 65px;

left: 348px;

}

.hotwords a {

margin: 0 11px;

}

.shopcar {

position: absolute;

top: 25px;

right: 64px;

width: 138px;

height: 34px;

border: 1px solid #dfdfdf;

background-color: #f7f7f7;

line-height: 34px;

text-align: center;

}

.car {

font-family: ‘icomoon’;

color: #da5555;

}

.arrow {

font-family: ‘icomoon’;

margin-left: 5px;

}

.count {

/不要给行宽,用padding撑开盒子/

position: absolute;

top: -5px;

/应该是左侧对齐,文字才会往右走/

left: 100px;

background-color: #e60012;

height: 14px;

padding: 0 3px;

line-height: 14px;/因为继承了父亲行高34px所以要调整/

color: #fff;

/border-radius: 左上角 右上角 右下角 左下角;/

border-radius: 7px 7px 7px 0;

}

.nav {

height: 45px;

border-bottom: 2px solid #b1191a;

}

.dropdown {

width: 209px;

height: 45px;

}

.dropdown .dt {

width: 100%;

height: 100%;

background-color: #b1191a;

font-size: 16px;

color: #fff;

text-align: center;

line-height: 45px;

}

.dropdown .dd {

height: 465px;

background-color: #c81623;

margin-top: 2px;

}

.menu_items {

height: 31px;

line-height: 31px;

padding: 0 8px;

transition: all 0.5s;

}

.menu_items:hover {

padding-left: 20px;

}

.menu_items:hover {

background-color: #fff;

}

.menu_items a {

font-size: 14px;

color: #fff;

}

.menu_items:hover a {

color: #c81623;

}

.menu_items i {

float: right;

font-size: 18px;

color: #fff;

}

.navitems {

margin-left: 10px;

}

.navitems ul {

display: flex;

}

.navitems li a {

display: block;

height: 45px;

padding: 0 25px;

line-height: 45px;

font-size: 16px;

}

/footer部分/

.footer {

height: 386px;

padding-top: 30px;

background-color: #f5f5f5;

}

.mod_service {

height: 79px;

border-bottom: 1px solid #ccc;

}

.mod_service ul {

display: flex;

}

.mod_service ul li {

flex: 1;

}

.mod-service-icon {

float: left;

height: 50px;

width: 50px;

margin-left: 35px;

}

.mod_service_zheng {

background: url(…/images/icons.png) no-repeat -253px -3px;

}

.mod_service_tit {

float: left;

margin-left: 5px;

}

.mod_service_tit h5 {

margin: 5px 0;

}

.mod_service_kuai {

background: url(…/images/icons.png) no-repeat -255px -54px;

}

.mod_service_bao {

background: url(…/images/icons.png) no-repeat -257px -105px;

}

.mod_service_1 {

background: url(…/images/icons.png) no-repeat -259px -155px;

}

.mod_service_2 {

background: url(…/images/icons.png) no-repeat -255px -208px;

}

.mod_help {

display: flex;

height: 187px;

border-bottom: 1px solid #ccc;

}

.mod_help_item {

flex: 1;

padding: 20px 0 0 50px;

}

.mod_help_item dt {

height: 25px;

font-size: 16px;

}

.mod_help_item dd {

height: 22px;

}

.mod_help_app dt,

.mod_help_app p {

padding-left: 15px;

}

.mod_help_app img {

margin: 7px;

}

.mod_copyright_first {

margin: 20px 0 16px 100px;

}

.mod_copyright ul {

display: flex;

}

.mod_copyright ul li {

padding: 0 15px;

border-left: 2px solid #999;

}

.mod_copyright_info {

margin: 0 0 3px 240px;

}

.mod_copyright_second {

margin-left: 469px;

}

index.html


品优购-综合网购首选-正品低价、品质保障、配送及时、轻松购物!

<meta name=“description” content="品优购JD.CON-专业的综合网上购物商城,销售家

电、数码通讯、电脑、家居百货、服装服饰、母婴、图书、食品等数万个品牌优质商品.便

捷、诚信的服务,为您提供愉悦的网上购物体验!"/>

<meta name=“Keywords” content="网上购物,网上商城,手机,笔记本,电脑,MP3,CD,V

CD,DV,相机,数码,配件,手表,存储卡,品优购"/>

    • 21
      点赞
    • 13
      收藏
      觉得还不错? 一键收藏
    • 0
      评论

    “相关推荐”对你有帮助么?

    • 非常没帮助
    • 没帮助
    • 一般
    • 有帮助
    • 非常有帮助
    提交
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值