Jump to content

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


mazman13

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.