Title: wp-post-thumbnail classes
Last modified: August 20, 2016

---

# wp-post-thumbnail classes

 *  [danmerk](https://wordpress.org/support/users/danmerk/)
 * (@danmerk)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/wp-post-thumbnail-classes/)
 * Is there a simple explanation to styling featured image thumbnails other than
   having two classes get parsed in the browser? Seems really inefficient. I’d place
   a simple styling in the CSS, but it then becomes site wide and I have a few scenarios
   of featured image styles.
 * My code looks like this:
 *     ```
       <div>
       			<a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'doghouse'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a><?php the_excerpt();?>
       		</div>
       ```
   
 * The CSS looks like this now:
 *     ```
       .attachment-post-thumbnail{
       	display: inline;
       	float:left;
       	margin-right: 1em;
       	border: 1px solid #000000;
   
       }
       ```
   
 * Thanks.

Viewing 1 replies (of 1 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/wp-post-thumbnail-classes/#post-2259556)
 * If your theme uses the body_class() function, you should be able to style your
   featured images independence.

Viewing 1 replies (of 1 total)

The topic ‘wp-post-thumbnail classes’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/wp-post-thumbnail-classes/#post-2259556)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
