I am trying to achieve the effect shown on this site:
http://fofwebdesign.co.uk/template/_testing/scale-img/target-ratio-resize.htm
BUT this site does this using a background image for a div. I cannot use the background image, since the image is inside Wordpress and is dynamically used with the following code:
<div class="featured-image">
<?php the_post_thumbnail(); ?>
</div>
So, I tried the same approach and tried the following things: try and bring the image as a background image:
.featured-image {
max-width: 960px;
max-height: 150px;
*
height: 150px;
background-image: <?php the_post_thumbnail(); ?>;
background-size: cover;
background-position: center;
}
and using this:
background-image: url(<?php the_post_thumbnail(); ?>);
Alas, I can't get it to work - I'm not even sure I can use PHP inside a CSS document ...
So I'm looking for a way to achieve this image size only in the next class without using a background image ...
<div class="featured-image">
<?php the_post_thumbnail(); ?>
</div>
- , , - - !
, :
