1

I've built this responsive site on WordPress and got a little curious as to how I can set the post thumbnails in percentages. Any help would be much appreciated.

2 Answers 2

0

This is not possible, images must have real absolute sizes :)

A post thumbnail is essentially a different sized version of the image. While you can calculate how much for example 70% of 1024 is, and genereate a ~700px wide image, you cannot do this for each of your visitors. It would kill your host's CPU...

The closest thing you can do is to browser-resize images to fit their container:

img{
  max-width: 100%;
  height: auto;
}
1
  • That's what I'm doing now, I was just really curious to see if that could be done with WordPress or not. Thanks for confirming this for me :) Commented Apr 11, 2012 at 13:01
0

Follow up to @OneTrickPony A:

You could also use a background image, resize the container accordingly and then add background-size: contain;.

1
  • Yeah, I thought of that but I wanted to see if doing it this way would possible. Commented Apr 11, 2012 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.