开发者

Why doesn't my sprite show

开发者 https://www.devze.com 2023-03-24 06:02 出处:网络
I\'m trying to use a sprite to show an image, but nothing appears, just white space.This is in an ASP.NET program.

I'm trying to use a sprite to show an image, but nothing appears, just white space.This is in an ASP.NET program.

This is just the first image here, located at 0,0 in the sprite.

The image declaration:

<asp:Image CssClass="sprite-ImageAccess" ID="Image4开发者_运维知识库" runat="server"/> &nbsp;Image 1<br />

In Page_Load, I set its ImageURL to a one pixel transparent gif:

Image4.ImageUrl = "data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";

For the CSS class I have:

.sprite-ImageAccess {  
    background: url("images/SpriteImages.png") no-repeat top left; 
    background-position:  0 0; 
    width: 13px; 
    height: 13px;
} 

My images are horizontal with each being 13 pixes wide.

All I get is white where the background image should show?

Any ideas? Maybe my gif is not really transparent?

0

精彩评论

暂无评论...
验证码 换一张
取 消