/    Sign up×
Community /Pin to ProfileBookmark

CSS Linking to variable images (Background Image) Question

Hi I am referencing an image from a variable in asp and I need to put a transparent wrapper on top of the image. I’ve tried all of the standard methods of accomplishing this but it keeps putting the variable image in front no matter what.

I was able to get the variable image in back but only if I make it the background image. The problem with that is I don’t think you can auto resize a background image? That’s essentially my question unless someone else has another idea.

Thanks!

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@zinigorFeb 21.2008 — Do your variable images change when the page is already loaded? Or do you mean that it is only different each time the page is requested?

If the latter is true, you can use the method flickr employs. But for that you have to know the dimensions of the picture.

Put a transparent gif after the picture and define it's width and height equal to those of the picture. You can define inline styles with asp. Then you have to make the transparent image absolutely positioned and place it on top of the picture by declaring "left" and "top" properties.

You can be sure it's positioned correctly if you put the picture inside a relatively positioned block that fits the picture's width and height.

You can always see how it's done in Flickr, it's the easiest way that comes to my mind.
Copy linkTweet thisAlerts:
@theflyingminstauthorFeb 21.2008 — Yeah the transparent .gif is the only one that is going to be pre-sized. Thanks so much for the helpful info, I am gonna look into that!
×

Success!

Help @theflyingminst spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...