实训小项目5:百度侧边栏

 实现以下效果:

所需图片如下:

实现代码如下:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			.baidu {
				width: 100%;
				height: 1200px;
			}
			.sidebar{
				position: fixed;
				right: 10%;
				bottom: 50px;
			}
			.sidebar ul{
				list-style-type: none;
			}
			.sidebar ul li {
				margin-bottom: 3px;
				width: 48px;
				height: 48px;
				background-color: beige;
				border-radius: 3px;
				background-image: url(img/baidu_jingling.png);
				background-repeat: no-repeat;
				position: relative;
				overflow: hidden;
			}
			.sidebar ul li:nth-child(1){
				background-image: url(img/baidu_yaoyan.png);
				height: 92px;
				background-size: 48px;
				background-repeat: no-repeat;
			}
			.sidebar ul li:nth-child(2){
				background-image: url(img/baidu_jubao.png);
				height: 92px;
				background-size: 48px;
				background-repeat: no-repeat;
			}
			.sidebar ul li:nth-child(3){
				background-position-y: -51px;
			}
			.sidebar ul li:nth-child(4){
				background-position-y: -204px;
			}
			.sidebar ul li:nth-child(5){
				background-position-y: -255px;
			}
			.sidebar ul li:nth-child(6){
				background-position-y: -306px;
			}
			.sidebar ul li a{
				text-decoration: none;
				color: white;
				display: block;
				width: 100%;
				height: 100%;
				font-weight: bold;
				font-size: 12px;
				text-align: center;
				line-height: 48px;
				background-color: royalblue;
				border-radius: 3px;
				position: absolute;
				transform: rotateZ(90deg);
				transform-origin: -50% 50%;
				transition: all 0.3s;
			}
			.sidebar ul li:nth-child(1) a,
			.sidebar ul li:nth-child(2) a{
				transform-origin: -100% 50%;
				line-height: 92px;
			}
			.sidebar ul li:hover a{
				transform: rotateZ(0deg);
				
			}
		</style>
	</head>
	<body>
		<div class="baidu">
			<div class="sidebar">
				<ul>
					<li><a href="">辟谣</a></li>
					<li><a href="">举报</a></li>
					<li><a href="">收藏网站</a></li>
					<li><a href="">搜索</a></li>
					<li><a href="">用户反馈</a></li>
					<li><a href="">返回顶部</a></li>
				</ul>
			</div>
		</div>
	</body>
</html>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值