/    Sign up×
Community /Pin to ProfileBookmark

img as a background

I’ve got this cell, with an img inside. How can I turn the image into the cell background?

thanks in advance

Here’s the code

<TABLE cellSpacing=2 cellPadding=1 border=1>
<TBODY>
<TR>
<TD><IMG src=”img.jpg” border=0></TD></TR></TBODY></TABLE>

Ciao
Ale

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@PhillMcSep 17.2004 — Now this will take some CSS.

You have 3 options, but I'll give you the easiest of the three. Try placing the following in your TD declaration:

style="background: url('img.jpg');"

That's an inline style block. To learn more about CSS and it's applications, check out the CSS and HTML tutorials link below.

Hope this helps. ?
Copy linkTweet thisAlerts:
@alexthecattaauthorOct 08.2004 — I've tried the suggestion u gave, and it works, thanks a lot.

But nowe I have another problem: the size of the image doesn't fit the size of the cell. The image is bigger then the cell I just can see a part of it.
Copy linkTweet thisAlerts:
@hastalavistaOct 08.2004 — style="background: url('img.jpg'); width: 40px; height: 25px;"

fill in the picture's width and height

might not work in ie in complex tables

regards
×

Success!

Help @alexthecatta 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...