/    Sign up×
Community /Pin to ProfileBookmark

how to resize a background image

Hello

I need to display an image as a background for a table cell
I am using the style background-image and it is working fine

Here is my problem
My table cell has a specific width of 100 pixels
The image that I need to display may have a width greater than 100.
Is there a way to tell the browser to resize the image to width of 100 pixels and then to display it as a background image?

Currently, it just displays the first 100 pixels of the image inside the cell and the rest of the pixels are cut off

I must use a background image (background-image) and not an image tag (img)

regards

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@SiddanMar 29.2006 — I would rather resize the picture in an image program. Mainly cus if you resize it in your browser the filesize will remain the same.
Copy linkTweet thisAlerts:
@NogDogMar 29.2006 — Nope. If it's to be used as a background, then you'll have to actually resize the image itself with the graphics editor of your choice.
Copy linkTweet thisAlerts:
@jasongrauthorMar 29.2006 — Thanks for the reponse

I will take that into consideration
Copy linkTweet thisAlerts:
@jasongrauthorMar 29.2006 — I also got the following link:

[URL=http://www.w3.org/TR/2002/WD-css3-ba...ackground-size]http://www.w3.org/TR/2002/WD-css3-ba...ackground-size[/URL]

for future CSS3
×

Success!

Help @jasongr 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.17,
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,
)...