how can I achieve something similar?
Basically, the question is: how can I position the small png with the corner from top left of the caption to be outside and to achieve this effect?
I am doing this to loop the latest category posts:
<div class="pages-thumbs">
<?php $cat_id = 19; $cat_link = get_category_link( $cat_id ); ?>
<a href="<?php echo the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
<?php the_post_thumbnail('medium'); ?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php the_excerpt(); ?>
</div>
</div>
Then, this is what I have for the h2 (css) in order to have that badge thing aligned to the top left:
.home-thumbs h2 {
background: url("images/top-left-label.png") no-repeat scroll left top #CBCBCB;
font-size: 12px;
margin-left: -8px;
margin-top: -66px;
max-width: 268px;
padding-left: 12px;
position: absolute;
}
This is how it is now based on the css I have:
Should I try another approach as I don't seem to be able to move the bg png outside my h2?
Reduce the background image to just the corner. Then edit your css as follows:
.home-thumbs h2 {
background: url("images/top-left-label.png") no-repeat scroll left top;
font-size: 12px;
margin-left: -8px;
margin-top: -66px;
max-width: 268px;
position: absolute;
}
.home-thumbs h2 span {
width: inherit;
background-color: #CBCBCB;
padding-left: 12px;
margin-top: HEIGHT OF H2 BG IMAGE;
}