Jump to content

[SOLVED] Can I resize/crop an image to a fixed layout section with CSS?


Recommended Posts

Lets say I have a section on my layout for a "headline" picture. 125 x 125

 

And in my backend I can upload a news story with a picture or no picture.

 

If I upload a picture, can I get CSS to resize it or crop it to fit in the 125 x 125 space...

without it getting all warped?

 

I'd rather have CSS do this than resize each image in photoshop if I want to upload something.

What is the best way?

not without it getting warped you can set width or height to 125 and it wont get warped but to force both is a bad idea plus why waste the load time of a full sized image if you only want it 125 by 125

 

 

look up a php script that creates thumbnails on the fly.

oops

 

anyway, example of setting thumbnail size dynamically http://www.waiming.com/pages/catalog.php

 

like dropfaith mentioned, you can use php. The thumbnails within the above page are all 250px x ???, resized  to 125px x ??? on the fly, that's the easy part.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.