直接说解决方法:
假设一张拼合好的大图大小是:900 x 1000 px (如上图)
现在想取图中左上角的河马图标,并缩小图标的大小。
正常取图:
立即学习“前端免费学习笔记(深入)”;
.sprite { background: url('imgs/woqu_localjoin_all.png') no-repeat -21px -80px; width: 190px;height: 154px;}<pre name="code" class="html">.sprite { background: url('all.png') no-repeat -10px -40px;width: 95px;height: 74px;background-size:450px 500px;}
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号