CSS布局练习,jd顶部导航栏跟下拉框

学习过程中并记录了这篇笔记

目录

css代码

html代码

效果


这里下拉框只做了一个例子,其他都是一样做法。里面有些图标字体我是截图然后使用img引入

这里我也引入了css样式重置文件。还有图标字体库

<link rel="stylesheet" href="./CSS/reset.css">
<link rel="stylesheet" href="./fa/css/all.css">

css代码

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

.nav a,
.nav i,
.nav span{
    color: #999;
    text-decoration: none;
}

.top-nav{
    background-color: #e3e4e5;
    border-bottom: 1px solid #ddd;
}

.nav{
    width: 1190px;
    height: 30px;
    line-height: 30px;
    margin: auto;
    position: relative;

}

.localtion{
    float: left;
}

.r-nav {
    float: right;
}

.r-nav li{
    float: left;
}

.top-nav a:hover,
.top-nav .hilight{
    color: #f10215;
}

.top-nav .spacer{
    width: 1px;
    height: 10px;
    background-color: #ccc;
    margin: 11px 14px 0;
}
.top-nav .img1{
    margin-bottom: 1px;
}
.localtion .localtion-shortcut{
    display: none;
    width: 300px;
    height: 442px;
    background-color: #fff;
    border: 1px solid #ccc;
    position: absolute;
    top:31px;
    z-index: 999;
}

.localtion:hover .localtion-shortcut{
    display: block;
}

.city{
    padding: 0 10px;
    padding-bottom: 1px;
    border: 1px solid transparent;
    position: relative;
    z-index: 9999;
}
.localtion:hover .city{
    background-color: #fff;
    border: 1px solid #ccc;
    border-bottom: none;
}
.localtion-shortcut{
    padding: 10px;
}
.local li{
    float: left;
    width: 60px;
}

.local a{
    float: left;
    padding: 0 8px;
}
.local a:hover{
    background-color: #faf0f0;
}

.local .BeiJing a{
    color: #fff;
    background-color: #f10215;
}
.local2{
    margin: 10px 0 10px 10px;
}

.split{
    width: 262px;
    border-bottom: 1px solid #eee;
    position: absolute;
    top: 230px;
}
.split1{
    width: 262px;
    border-bottom: 1px solid #eee;
    position: absolute;
    top:340px;
}
.local2 .t1{
    color: #8f8f8f;
    position: relative;
    top: 15px;
}
.lcoal-list li{
    float: left;
    width: 120px;
}
.lcoal-list .lcoal-first{
    padding-top: 15px;
}
.lcoal-firs
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值