Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 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 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 at 14:53

1 Answer 1

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"/>
</span>
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 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 at 15:52
    
You also need to watch for CSS specificity - but again, very off-topic from WordPress. –  Eric Holmes May 26 at 15:53
    
Asked on Stack Overflow. Turns out I was missing a closing } from the previous line of code. –  Smush May 26 at 16:02

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