/    Sign up×
Community /Pin to ProfileBookmark

Fixed Image Sizes

Can you set a fixed image size requirement for the whole page or section? Meaning if someone were to upload an image into a certain area that CSS will control the general size of the image. I know that there are going to be different dimensions involved here but I would like to control the general size of it. For example if I wanted the image to be no taller then 250px then the image should stay within those realms but horizontal pixels will adjust accordingly without getting out of the aspect ratio.

Thank you for any help provided.

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@toicontienApr 05.2006 — That is best left to a server side script. PHP has a nice library of functions that work with images of many types. You could also create a generic class for a DIV tag that contains said images, and have the CSS styles hide the overflow or make the overflow of the DIV scrollable. That would not resize the image though. If you want to resize the images, then your best bet is using a server side script to process the uploaded images, reduce them in physical size and save them to the server's local file system.
×

Success!

Help @MontyV 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.18,
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,
)...