本文介绍了如何在HTML中显示多帧GIF格式图像的特定帧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个具有多帧的GIF格式的图像:
Hi,
I have a GIF-formatted image with multi frames:
<img src="http://...SampleAddress.../specials.gif" alt="star">
我只想显示包含星形"图像的框架.我应该如何更改HTML代码?
I want to show just the frame containing the "star" image. How should I change the HTML code?
推荐答案
#menuItem1
{
background-image: url(http://www.myserver.com/images/menuSprite.gif);
background-position: 0px 0px;
}
#menuItem1:hover
{
background-image: url(http://www.myserver.com/images/menuSprite.gif);
background-position: -100px 0px;
}
这是Smashing Magazine上有关CSS精灵的一篇很好的文章,链接到许多工具和教程:
http://www.smashingmagazine.com /2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/ [ ^ ]
Here is a good article about CSS sprites from Smashing Magazine that links to a bunch of tools and tutorials:
http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/[^]
这篇关于如何在HTML中显示多帧GIF格式图像的特定帧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!