Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Scaling images, retaining aspect Ratio
Old 04-03-2008, 12:27 PM Scaling images, retaining aspect Ratio
Extreme Talker

Posts: 177
Trades: 0
Can anyone give me any insight on how to properly scale images so they don't look all funked up? Say I want the limitations of the picture to be no bigger then 300px high and 250px wide. The dimensions don't HAVE to be of those proportions, but those are the constraints.

How would I check the image, and keep it to no larger then those dimensions, and make sure it doesn't look distroted?

Thanks
kbfirebreather is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-03-2008, 12:55 PM Re: Scaling images, retaining aspect Ratio
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
If you change the width of an image in the CSS document the height will change proportionally. You can specify the max width as such:
Code:
img#whatever {
    max-width: 250px;
}
This doesn't work in IE6(or below). There is a way to work around it with javascript, but I'm not well versed in this method.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-03-2008, 01:44 PM Re: Scaling images, retaining aspect Ratio
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
just batch process the images in your image editor?!
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 04-03-2008, 01:58 PM Re: Scaling images, retaining aspect Ratio
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I usually just use max-width and min-width, etc without worrying about the minor annoyance of this not functioning in IE6. IE6 is never going to live up to the better browsers completely, and the fact that it does not display perfectly in all situations hopefully sends a message that it is time to upgrade your browser
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-03-2008, 02:05 PM Re: Scaling images, retaining aspect Ratio
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
but doesn't it look like crap when you resize the image through the browser?!
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 04-03-2008, 03:25 PM Re: Scaling images, retaining aspect Ratio
Extreme Talker

Posts: 177
Trades: 0
Well the only problem with setting max-width, is it can't also exceed the height.
kbfirebreather is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Scaling images, retaining aspect Ratio
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.52468 seconds with 12 queries