/    Sign up×
Community /Pin to ProfileBookmark

Unwanted IMG Ratio when re-sizing

Hey everyone,

I’m attempted to resize an image in Firefox, but when I change the width, the height will change as well (and visa versa). It wants to keep the original ratio of the image.

Here some sample code and results

[code]
with(myImg.style)
{
// … more above
width = 20;
// … more below
}
[/code]

The image will come out as 20 x 20 not 20 x 32 (32 x 32 was the original dimension).

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@ray326Apr 28.2006 — Never use the img width/height attributes to resize an image.
Copy linkTweet thisAlerts:
@L0phtpDKauthorApr 28.2006 — Ok....

What do you use then...
Copy linkTweet thisAlerts:
@ray326Apr 29.2006 — Compupic, Painter, Photoshop Elements, PhotoImpact, The GIMP, Picassa, IrfanView
Copy linkTweet thisAlerts:
@L0phtpDKauthorApr 29.2006 — I think you're missing the point...

I want to change the dimensions so that it expands the area covered... dynamically.

So if I have a special border (in 8 sections... 4 corners and 4 edges) I want the edges to expand dynamically with the 'div'. So I can not have a static image.
Copy linkTweet thisAlerts:
@ray326Apr 30.2006 — Then use percentages relative to the container but you're stuck with whatever you get out of each browser because that is not the purpose of those attributes.
×

Success!

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

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

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