当前位置:网站首页>2021-01-11-雪碧图做表情管理器
2021-01-11-雪碧图做表情管理器
2022-08-09 10:03:00 【高桥靓仔】
雪碧图做表情管理器
雪碧图的原理:将所有的表情都放在一张大图上,然后使用background-image、 background-position、width、height属性去定位显示每个表情。(所以需要预先做一个表情定位的映射表)

//<i class="icon icon-home"></i>
:global {
.icon-s01 {
background-image: url(http://xdfe-new.s3.cn-east-2.jdcloud-oss.com/apps/xiaoduo-robot-merchant-platform/jd-emotions/sprite.png);
background-position: -24px 0;
width: 24px;
height: 24px;
}
.icon-s02 {
background-image: url(http://xdfe-new.s3.cn-east-2.jdcloud-oss.com/apps/xiaoduo-robot-merchant-platform/jd-emotions/sprite.png);
background-position: -144px 0;
width: 24px;
height: 24px;
}
...
}
边栏推荐
猜你喜欢
随机推荐
8. Recursively traverse and delete cases
多线程(基础)
Practical skills: a key for image information in the Harbor, quick query image
Sweet alert
2. Byte stream
排序1:冒泡排序
LeetCode75:颜色分类-C语言一次遍历求解
nacos从下载到安装集群的
Multi-threaded cases - timer
mysql简单安装
7.Collections tool class
Celebrate ranked 18
1: bubble sort
LeetCode179:最大数(C语言)代码简洁!
日期操作比较全面得代码
如何快速打通镜像发布流程?
class object property method class member
3. Practice the Thread
LeetCode56:合并区间 C语言解法,注解详细 一看就懂!
[Machine Learning] Detailed explanation of web crawler combat
![[贴装专题] 贴装流程中涉及到的位置关系计算](/img/72/a60a51c86e641749f38fab66f1236a.png)








