前端实训-背景+字体图标+雪碧图

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="lib/iconfont/iconfont.css">
		<style>
			.btn1{
				/*需要添加url在三个字母*/
				background-image: url(img/src=http___imgedu.lagou.com_1837519-20191107151128254-1992912590.png&refer=http___imgedu.lagou.jpg);
				height: 200px;
				background-repeat: no-repeat; /*只显示一次不重复叠加*/
				/* background-size: 100% 100%; /*设置宽度和高度用于拉伸*/
				background-position: center;	/*背景图片定位*/
			}
			.btn2{
				height: 42px;
				width: 37px;
				background-image: url(img/src=http___imgedu.lagou.com_1837519-20191107151128254-1992912590.png&refer=http___imgedu.lagou.jpg);
				background-repeat: no-repeat; /*只显示一次不重复叠加*/
				background-position: -376px 0px;
			}
			.btn3{
				height: 42px;
				width: 39px;
				background-image: url(img/src=http___imgedu.lagou.com_1837519-20191107151128254-1992912590.png&refer=http___imgedu.lagou.jpg);
				background-repeat: no-repeat; /*只显示一次不重复叠加*/
				background-position: -374px -50px;
			}
			.box{
				height: 40px;
				width: 40px;
				border-radius: 50%;
				background-color: pink;
				text-align: center;/*水平中间*/
				line-height: 40px;
				color: white;
				font-weight: 600;
			}
		</style>
	</head>
	<body>
		/*背景设置调整*/
		<div class='btn1'></div>

		<!--雪碧图,精灵图截取小图标用这种方式,这种图的使用也是为了节约内存-->
		<div class='btn2'></div>
		
		<div class='btn3'></div>
		
		/*字体图标*/
		<div class="box">
			<span class="iconfont icon-xin"></span>
		</div>
	</body>
</html>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值