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.

CSS Forum


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



Reply
Old 09-15-2007, 04:26 PM Set a max size?
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
hello,

ok, i have this thing where i have images and i want to set a max width/height but if possible not like a exact one so it streches them

so i could have a maxheight 120 and a maxwidth 200 and if the image is say 110 X 300 it would make it would make it 200 width and then scale the height and not strech to 120

and similarly if i had a image that was 200 X 100 it would make it 120 height and scale the width

Do people know what i mean?

how would i do it?

Thanks

TP for good ansers
dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
Register now for full access!
Old 09-15-2007, 05:44 PM Re: Set a max size?
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Through CSS, you couldn't. Max width and height don't extend to proportionate stretching.

For a purely client-side solution, the only thing that would work as even a partial solution would be Javascript. For a server-side solution...that depends on your language, but I think you'd have better luck that way.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 09-15-2007, 05:59 PM Re: Set a max size?
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
So you want to constrain your image size but dont know whether your images will be portrait or landscape ???

Just give your image placeholder a designated height but no width and your images will fill the placeholder without deformation. Don't know if this what your after.
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 09-15-2007, 06:22 PM Re: Set a max size?
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
well i did that and most of the images were fine the scaled down.

but one or two which height was smaller than the constriant height scaled up and the width went huge...
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 09-16-2007, 02:29 AM Re: Set a max size?
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
You should be all right if you put your image within a div which has a fixed width and height to match the max width and height of the image.
maxxximus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Set a max size?
 

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 0.28696 seconds with 12 queries