thumbnail not scaling to fit container
-
Hi, Ive been a long time wordpress user but only now on the forums as I was searching all over the internet to find an answer to my template problem, with no luck, unfortunately.
I’m trying to scale (resize and crop) my featured images to fit the container on the front page, but all it seems to let me do is either resize (and then stretch as it’s not in proportion anymore) or scale (which would only give me only the upper left corner of my image). This is my code on the page:
<div class="featured-thumbnail"><?php if (has_post_thumbnail()) {the_post_thumbnail();} ?></div>
And the CSS:
.featured-thumbnail { float: left; overflow: hidden; margin: 10px 10px 10px 0; height: 150px; width: 150px; } .featured-thumbnail img { overflow: hidden; max-width: auto; display: inline; }
Help is very much appreciated! Have been struggling with what is supposed to be a simple thing for what seems like decades now. Thanks in advance!
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘thumbnail not scaling to fit container’ is closed to new replies.