- Posts: 1
- Thank you received: 0
Auto resize image to fit client area
15 years 4 months ago #4708
by maxcr73
Auto resize image to fit client area was created by maxcr73
Hi,
when browser starts is there a way to fit automatically the image into the client area?
I've tried this great component but on some computers images are greater than monitor resolution so scroll bars appears on browser. Can image auto resized?
Thanks
Max
when browser starts is there a way to fit automatically the image into the client area?
I've tried this great component but on some computers images are greater than monitor resolution so scroll bars appears on browser. Can image auto resized?
Thanks
Max
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Offline
- Moderator
-
Less
More
- Posts: 14116
- Thank you received: 1639
15 years 4 months ago #4721
by ivan.milic
Replied by ivan.milic on topic Re: Auto resize image to fit client area
You can put image width or height to around 100%. Around is because you have parent tag padding and image margin , so 100% would be only if image margin is 0, and padding of it's parent is 0 - otherwise scrollbars appear or part of image becomes cut off depending on many things...
To preserve ratio of image you must set this only to one dimension (chose width or height)
Do this from css or using style attribute.
To preserve ratio of image you must set this only to one dimension (chose width or height)
Do this from css or using style attribute.
Please Log in to join the conversation.
Time to create page: 0.142 seconds