1 Star 0 Fork 0

郭海南 / 前端CSS知识点

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
5.8精灵图案例.html 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
郭海南 提交于 2022-12-15 21:56 . backup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<br>
<hr>
<span class="p">1</span>
<span class="i">2</span>
<span class="n">3</span>
<span class="k">4</span>
</body>
<style>
.box1 {
width: 60px;
height: 60px;
background-color: pink;
margin: 100px auto;
/* 精灵图对齐 */
background: url(./4.5学成在线案例根目录/images/pic_sprites.png) -182px 0 no-repeat;
/* 也可以单独调整位置 */
/* background-position: -182px 0; */
}
.box2 {
width: 27px;
height: 25px;
background-color: pink;
margin: 200px;
background: url(./4.5学成在线案例根目录/images/pic_sprites.png) no-repeat -155px -106px;
}
span {
display: inline-block;
}
.p {
width: 100px;
height: 112px;
background: url(./4.5学成在线案例根目录/images/26字母精灵图.jpg) no-repeat -493px -276px;
}
.i {
width: 60px;
height: 108px;
background: url(./4.5学成在线案例根目录/images/26字母精灵图.jpg) no-repeat -327px -142px;
}
</style>
</html>
CSS
1
https://gitee.com/guohainan66/front-end-css-knowledge-points.git
git@gitee.com:guohainan66/front-end-css-knowledge-points.git
guohainan66
front-end-css-knowledge-points
前端CSS知识点
master

搜索帮助