Keep WordPress thumbnails from getting squished by max-width in CSS

I set my WordPress post thumbnails to max out at a certain height and width, but they're distorting every image to be exactly that height and width. (No, I'm not on IE, I know IE<7 screws this up, I'll worry about that later. I'm on Firefox 3.6.) Here's my CSS:

.wp-post-image {border: 1px solid black; float:right; margin:10px 40px; max-height:150px; max-width:200px;}

What should I do?
nbierm65Asked:
Who is Participating?
 
gwkgCommented:
let Wordpress control the image size instead of css

in functions.php

add_image_size('whatever',200,150,true);

then you can display the thumbnail in your template file with

if (has_post_thumbnail()) {
                 
    the_post_thumbnail('whatever');
                 
 }
0
 
nbierm65Author Commented:
ok i'll try that
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.