WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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