How to correctly apply a CSS style to all the images in a div having a specific class?

13,276
.group-item img {
    float: left;
    margin-right: 15px;
    width: 80px;
}

should work, I removed the s from groups- in the css declaration

Share:
13,276
AndreaNobili
Author by

AndreaNobili

Updated on June 04, 2022

Comments

  • AndreaNobili
    AndreaNobili about 2 years

    I have the following HTML:

    <div class="group-item">
        <a href="profile.html">
            <img src="resources/img/icons/projects/wifi.png">
        </a>
    </div>
    

    I am trying to set the CSS property of the img tag inside the div having class="group-item" in this way:

    .groups-item img {
        float: left;
        margin-right: 15px;
        width: 80px;
    }
    

    but it does not work and it is not applied to the previous img tag (I used FireBug and I can see that the style is not applied)

    Why? What am I missing? How can I correctly apply the style to all the img tags inside the div having class="group-item"?

  • mplungjan
    mplungjan almost 9 years
    Seriously not worth an answer
  • mplungjan
    mplungjan almost 9 years
    Because I edited it before I tested to see what was wrong. Then I commented that it was a spelling mistake instead of answering it was a spelling mistake
  • Toni Leigh
    Toni Leigh almost 9 years
    @mplungjan - fair enough, still, you have 50k points, I have 1.5k, I'm just trying to pull myself up a bit being new to the site, so I'll take some low hanging fruit here and there