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'm trying to position images next to several bullet lists in such a way the global default doesn't achieve so in my style.css file for the child theme I have my selector as

.activities img{ code here; }

then on the page I'm applying it to I find an img tag make it look like

<img class="activities" src"linktoimage.png"/>

When I refresh nothing happens to the image. I've tried using ID instead of class and putting the image within a DIV that uses the selector none of which has any effect.

I'm possibly doing it wrong so any help would be appreciated thanks

share|improve this question

closed as off-topic by ialocin, toscho May 26 '14 at 20:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

Better ask to ask the experts at Stackoverflow who specialize in CSS. stackoverflow.com/questions/tagged/css – Brad Dalton May 26 '14 at 14:47
Ok thanks. I posted here as I thought it might be something to do with the way Wordpress processes the code – Smush May 26 '14 at 14:53
up vote 1 down vote accepted

This is off-topic, as it's a CSS question, not a WordPress question. That being said.. You need to attach your class to your tag. Use:

img.activities {
    /* stuff here */

Your current CSS selector targets this:

<span class="activities">
    <img src="image.png"/>
share|improve this answer
I've tried img.activities and it does not work. padding-left:30px; and not one sign of movement. – Smush May 26 '14 at 14:52
Try something drastic, like display: none !important;. You could have some other styles overriding you, or if the <img> has display: inline attached to it, padding probably won't do anything. – Eric Holmes May 26 '14 at 15:52
You also need to watch for CSS specificity - but again, very off-topic from WordPress. – Eric Holmes May 26 '14 at 15:53
Asked on Stack Overflow. Turns out I was missing a closing } from the previous line of code. – Smush May 26 '14 at 16:02

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