3

I have used background-position: (0)px (0)px; many times in css along with background-image: url(.....); But I wonder if I can use this Css property in IMAGE tag or not. What actually I want is something like this;

<a href="(some line page.html)" target="_blank"><img style="float: left; background-position: 0px 0px;" src="images/variousthumbnails.jpg" alt="Thumbnail 1" width="100" height="98" /></a>

"variousthumbnails.jpg" contains 9 images of width 100px and height 98px each. I want to display the first thumbnail which is at "0px 0px" in this image tag, and so on for the others. kindly let me know, if its possible.

I can't use background-image in css.

Thank you.

4

1 回答 1

1

我相信您所指的是一种称为 CSS Sprites 的方法。

您使用其中包含许多较小图像的一张大图像,因此您只需为页面的所有用途加载一张图像。

这是一个很好的概述:CSS - 使用一个背景图像和多个图像

于 2013-11-01T04:22:01.367 回答