CSS特殊样式(九)悬浮效果菜单

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>悬浮效果菜单</title>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<style>
*::before,*::after {
	box-sizing:border-box;
}
.leaderboard {
	position:absolute;
	top:20px;
	left:10px;
	width:375px;
	height:200px;
	background:#F0F0F0;
	border-radius:10px;
	box-shadow:0 7px 30px rgba(62,9,11,0.3);
}
.leaderboard h1 {
	font-size:18px;
	height:30px;
	line-height:30px;
	text-align:center;
}
.leaderboard h1 svg {
	width:25px;
	height:26px;
	position:relative;
	margin-right:0px;
	vertical-align:baseline;
}
.leaderboard ol {
	counter-reset:leaderboard;
}
.leaderboard ol li {
	position:relative;
	z-index:1;
	font-size:13px;
	font-family:微软雅黑;
	counter-increment:leaderboard;
	padding:18px 0px 10px 0px;
	cursor:pointer;
}
.leaderboard ol li::before {
	content:counter(leaderboard);
	position:absolute;
	z-index:2;
	top:6px;
	left:10px;
	width:15px;
	height:15px;
	line-height:15px;
	color:#4D6999;
	background:#fff;
	border-radius:20px;
	text-align:center;
}
.leaderboard ol li mark {
	position:absolute;
	z-index:2;
	top:-1px;
	left:-10px;
	width:100%;
	padding:8px 10px 18px 50px;
	margin:0;
	background:none;
	color:#fff;
}
.leaderboard ol li mark::before,.leaderboard ol li mark::after {
	content:'';
	position:absolute;
	z-index:1;
	-webkit-transition:all .1s ease-in-out;
	transition:all .1s ease-in-out;
	opacity:0;
}
.leaderboard ol li mark::after {
	left:auto;
	right:-9px;
	border-left:none;
	border-right:10px solid transparent;
}
.leaderboard ol li small {
	position:relative;
	z-index:2;
	display:block;
	text-align:right;
}
.leaderboard ol li::after {
	content:'';
	position:absolute;
	z-index:1;
	top:0;
	left:0;
	width:100%;
	height:100%;
	background:none;
	box-shadow:0 3px 0 rgba(0,0,0,0.08);
	-webkit-transition:all .3s ease-in-out;
	transition:all .3s ease-in-out;
	opacity:0;
}
.leaderboard ol li {
	background:#7E98BE;
	border:1px solid lightgrey;
	border-width:0px 1px 1px 1px;
}
.leaderboard ol li::after {
	background:#637FB0;
	border-radius:3px;
}
.leaderboard ol li:hover {
	z-index:2;
	overflow:visible;
}
.leaderboard ol li:hover::after {
	opacity:1;
	-webkit-transform:scaleX(1.06) scaleY(1.03);
	transform:scaleX(1.06) scaleY(1.03);
}
.leaderboard ol li:hover mark::before,.leaderboard ol li:hover mark::after {
	opacity:1;
	-webkit-transition:all .35s ease-in-out;
	transition:all .35s ease-in-out;
}
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
	margin:0;
	padding:0;
	border:0;
	font-size:100%;
	font:inherit;
	vertical-align:baseline
}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {
	display:block
}
body {
	line-height:1
}
ol,ul {
	list-style:none
}
blockquote,q {
	quotes:none
}
blockquote:before,blockquote:after,q:before,q:after {
	content:'';
	content:none
}
table {
	border-collapse:collapse;
	border-spacing:0
}
a:link,a:hover,a:visited,a:active {
	text-decoration:none;
	color:#fff;
}
</style>
</head>
<body>
<div class="leaderboard">
    <h1>目       录</h1>
    <ol class="part1">
        <li><mark><a href="#">123</a></mark></li>
        <li><mark><a href="#">123</a></mark></li>
        <li><mark><a href="#">123</a></mark></li>
        <li><mark><a href="#">123</a></mark></li>
        <li><mark><a href="#">123</a></mark></li>
    </ol>
</div>

<script>

</script>

</body>
</html>



效果图:

得意



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值