html5定义一个选择框,HTML5一款黑白色调的自定义下拉列表选择框

CSS

语言:

CSSSCSS

确定

*,

*:after,

*:before {

box-sizing: border-box;

}

html {

box-sizing: inherit;

background: -webkit-linear-gradient(right, #8e9eab, #eef2f3);

background: linear-gradient(to left, #8e9eab, #eef2f3);

}

body {

margin: 10% auto;

text-align: center;

font-size: 12px;

}

.select {

position: relative;

display: block;

margin: 0 auto;

width: 100%;

max-width: 325px;

color: #cccccc;

vertical-align: middle;

text-align: left;

-webkit-user-select: none;

-moz-user-select: none;

-ms-user-select: none;

user-select: none;

-webkit-touch-callout: none;

}

.select .placeholder {

position: relative;

display: block;

background-color: #393d41;

z-index: 1;

padding: 1em;

border-radius: 2px;

cursor: pointer;

}

.select .placeholder:hover {

background: #34383c;

}

.select .placeholder:after {

position: absolute;

right: 1em;

top: 50%;

-webkit-transform: translateY(-50%);

transform: translateY(-50%);

font-family: 'FontAwesome';

content: '\f078';

z-index: 10;

}

.select.is-open .placeholder:after {

content: '\f077';

}

.select.is-open ul {

display: block;

}

.select.select--white .placeholder {

background: #fff;

color: #999;

}

.select.select--white .placeholder:hover {

background: #fafafa;

}

.select ul {

display: none;

position: absolute;

overflow: hidden;

width: 100%;

background: #fff;

border-radius: 2px;

top: 100%;

left: 0;

list-style: none;

margin: 5px 0 0 0;

padding: 0;

z-index: 100;

}

.select ul li {

display: block;

text-align: left;

padding: 0.8em 1em 0.8em 1em;

color: #999;

cursor: pointer;

}

.select ul li:hover {

background: #4ebbf0;

color: #fff;

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值