I have uploaded a media picture to a post the HTML I saw as such

<a href="http://localhost/self/wp-content/uploads/2013/03/pic1.png"><img src="http://localhost/self/wp-content/uploads/2013/03/pic1.png" alt="pic1" width="260" height="260" class="alignnone size-full wp-image-204" />

How do I css style on this image? I can't use class="alignnone size-full wp-image-204" because on the next new post, that class name could be different. All my post will have exactly one image and will be in the same location.

1 Answer 1


In most themes you will be able to target every image in all your posts with the following css:

.type-post img { PUT CSS STYLES HERE }

This may not work, however, depending on the theme you're using, and whether or not your new styles conflict with higher-priority css. If you post a link to your website I can give you a definitive answer.

  • if it's custom type, for example, rating type, I could do .type-rating img { ...}
    – jason hong
    Apr 4, 2013 at 23:49
  • Generally, yes. If you post a link I can help you more.
    – Griffin
    Apr 5, 2013 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.